我現在有一個圖象,三個UILabels,並在細胞中一個TextView並希望使用該數據在一個單獨的視圖控制器。視圖控制器目前通過push segue連接到單元,我應該怎麼做才能實現這一點?訪問火力地堡數據
我有這個,但它不工作:
let uid = FIRAuth.auth()?.currentUser?.uid
FIRDatabase.database().reference().child("users").child(uid!).observeSingleEvent(of: .value, with: { (snapshot) in
if let dictionary = snapshot.value as? [String: AnyObject] {
self.userLabel.text = dictionary["username"] as? String
}
})
我要補充到DetailsViewController(單獨的視圖控制器)和MainViewController以下哪種? – gabe