@IBAction func onEqualPressed(sender: AnyObject) {
let userID = Auth.auth().currentUser?.uid
ref.child("users").child(userID!).observeSingleEvent(of: .value, with: { (snapshot) in
// Get user value
let value = snapshot.value as? NSDictionary
let securityPin = value?["SecurityPin"] as? String ?? ""
let digit = self.outputLbl.text
let user = User(username: securityPin)
if digit == (securityPin) {
self.showRealMenuScreen()
}
if digit != (securityPin) {
self.stayOnCalculator()
} else {
self.processOperation(operation: self.currentOperation)
}
}) { (error) in
print(error.localizedDescription)
}
}
我一直收到这个错误:
传递给不带参数的调用的参数:User(用户名:securityPin)