RxFirebase icon indicating copy to clipboard operation
RxFirebase copied to clipboard

Initializer for conditional binding must have Optional type, not 'DocumentSnapshot'

Open MarsXan opened this issue 5 years ago • 0 comments

DocumentSnapshot always has value. we can't use this for checking a value exist or not!

db.collection("cities") .document("SF") .rx .getDocument() .subscribe(onNext: { document in if let document = document { print("Document data: \(document.data())") } else { print("Document does not exist") } }, onError: { error in print("Error fetching snapshots: \(error)") }).disposed(by: DisposeBag())

MarsXan avatar Mar 28 '20 08:03 MarsXan