Code not finishing the function, it is ending execution halfway through
问题 My code is as follows: @IBAction func clicked(_ sender: Any) { let ref = Database.database().reference() let pass = password.text var firpass = "" var bool = false; ref.child(name.text as! String).child("password").observeSingleEvent(of: .value, with: { dataSnapshot in firpass = dataSnapshot.value as! String if firpass == pass { bool = true print("in here") } }) print(bool) if bool { self.sendname = name.text! let vc = DatabaseTableViewController(nibName: "DatabaseTableViewController", bundle