3

I use firebase's Realtime Database to make asynchronous database queries from my app. Now that iOS 15 gives us Swift 5.5, I'd love to use async/await to perform those queries instead of passing completion closures.

I know that I can use await withCheckedThrowingContinuation { } to build async versions from the existing firebase functions. But do async versions already exist? Either in firebase or auto-synthesized by Xcode?

George
  • 25,988
  • 10
  • 79
  • 133
Anton
  • 2,512
  • 2
  • 20
  • 36

1 Answers1

5

Many of the Realtime Database asynchronous APIs are available via Xcode's auto-synthesizing.

They will show up in Xcode auto-completion.

There are several examples visible at https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseDatabase/Tests/Unit/Swift/DatabaseAPITests.swift

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139