Ambiguous use of observe firebase DB
Change this:
ref.child("Settings").child("service_types").observe(.value) { (snapshot) in
}
to this:
ref.child("Settings").child("service_types").observe(.value, with: { snapshot in
})
See also firebase documentation section Listen for value events
Ambiguous use of 'observeSingleEvent(of: with:)
Working solution for Swift 3:
databaseRef.child("Users").queryOrderedByKey().observe(.childAdded, with: { snapshot in
})
Firebase 3: Ambiguous use of 'observeEventType(_:withBlock:)'
It seems like it's a Swift bug, try to use this syntax instead (without trailing closure syntax.):
ref.observeEventType(.Value, withBlock: { firDataSnapshot in
})
More info: Ambiguous use of 'observeSingleEventOfType(_:withBlock:)' error in Swift
Ambiguous use of 'subscript(_:)' after Pod Install
Why subscript snapshot.value every time it's used?
let ref = Database.database().reference()
ref.child("Postbox").observe(.childAdded, with: { (snapshot) in
let data = snapshot.value as? NSDictionary
let monToFri = data!["Monday to Friday Collection Time"] as? String ?? "Empty String"
// Other code....
}
Ambiguous use of 'subscript' and Cannot call value of non-function type 'AnyObject' errors retrieving data from Firebase in SWIFT 4.1
You changed []
to ()
let dic = snapshot.value as! [String:String]
let date = dic["Date"]
let time = dic["Time"]
let latitude = dic["Latitude"]
let longitude = dic["Longitude"]
let desc = dic["Description"]
Related Topics
Swift Optional Type: How .None == Nil Works
How to Refresh Multiple Timers in Widget iOS14
Why Doesn't Swift Force My Designated Initializer to Call Super
Swift Spritekit Arc for Dummies
How How to Perform Multiple Alamofire Requests That Are Finished One After Another
Swift MAC App, Run Terminal Command Without Knowing the Path (So It Looks in Every Path in $Path)
Implementing Stringliteralconvertible on Nsurl
How to Draw Dashed Line in Arkit (Scenekit) Like in the Measure App
How to Open a Url in Safari Even If My Default Browser Is Not Safari Using Swift in MACos
How to Create and Access Share App Group Document Directory
How Set Custom Fonts for iOS13 Context Menu Actions
Swift Error Using Initialized Properties in Expressions Before Super.Init
Hide View Item of Nsstackview with Animation
Why Does Somestruct() Is Anyobject Return True
Swift Callkit Sometimes Can't Activate Loudspeaker After Received Call (Only Incoming Call)
Sending Firebase Push Notifications to Logged-In Users Only