0
override func viewDidLoad() {
super.viewDidLoad()
let ref = FIRDatabase.database().reference()
ref.observe(.value, with: {
snapshot in
self.label1.text = (snapshot.value as AnyObject)["label"] as! String
}, withCancel: {
error in
print(error.description)
})
// Do any additional setup after loading the view, typically from a nib.
}
}, withCancel: {
行显示一个编译器错误:斯威夫特无法将类型的价值预期参数类型
cannot convert value of type '(_) ->()' to expected argument type '((Error) -> Void)'
如果有这将是一个很好的答案解释OP为什么会收到错误以及您的代码如何解决错误。 – Jim