当我点击通知时,我正在接收Push Notifications
当我点击我点击SlideMenu didSelectRow时,我想要转到特定的ViewController
。我尝试了很多SO链接但是在代码下面我可以转到特定的ViewController
,但问题是tabBar它没有显示。
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
let mainstoryboard = UIStoryboard(name: "Main", bundle: nil)
let ringingVC = mainstoryboard.instantiateViewController(withIdentifier: "RaffleResultViewController") as? RaffleResultViewController
window?.rootViewController = ringingVC
}
答案 0 :(得分:0)
let mainstoryboard = UIStoryboard(name: "Main", bundle: nil)
let ringingVC = mainstoryboard.instantiateViewController(withIdentifier: "RaffleResultViewController") as? RaffleResultViewController
let selectedVC = window.rootViewController
if let nav = selectedVC as? UINavigationController{
nav.pushViewController(ringingVC, animated: true)
}else{
selectedVC.present(ringingVC, animated: true, completion: nil)
}
//使用此