我试图从Firebase Swift 4中的实时数据库中检索数据

时间:2018-03-10 18:15:06

标签: firebase-realtime-database swift4

@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)

0 个答案:

没有答案