当用户收到推送通知时,viewController
会显示appDelegate
。
我的问题是,我无法找到一种方法来显示原始navigationController
及其navBar
和按钮。
请注意,我的应用有一个tabBarController
,包含4个项目,每个项目都有他的导航控制器。
=> navigationController A => VC1 => VC2
=> navigationController B => VC1 => VC2
navigationController => rootViewController => tabBar
=> navigationController C => VC1 => VC2
=> navigationController D => VC1 => VC2
所以我在viewWillAppear
尝试了这个但是没有用过:
override func viewWillAppear(animated: Bool) {
if self.navigationController == nil {
let navigationController = UIApplication.sharedApplication().windows[0].rootViewController as UINavigationController
self.navigationController == navigationController
}
}