我现在有一个图象,三个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