【发布时间】:2018-11-25 17:15:14
【问题描述】:
当您点击标题时,我想添加一个类似于 UITapGesture 的东西,它会转到另一个控制器。我认为 UITapGesture 仅适用于 UIView,但我希望它适用于文本(字符串)。
@objc func checkIfUserIsLoggedIn(){
if Auth.auth().currentUser?.uid == nil {
perform(#selector(viewController.handleLogout), with: nil, afterDelay: 0)
} else {
let uid = Auth.auth().currentUser?.uid
Database.database().reference().child("Users").child(uid!).observe(.value, with: { (snapshot) in
if let dictionary = snapshot.value as?[String : AnyObject] {
self.navigationItem.title = dictionary["Full Name"] as? String
}
}, withCancel: nil)
}
}
【问题讨论】:
-
你是说点击导航项中的标题吗?
-
是的,我想点击标题将我转移到另一个控制器
标签: ios swift uinavigationitem