我试图在用户单击UILocalNotification时从swift中的app delegate加载特定的ViewController.我已经发现在这个函数中调用了它:
func application(application: UIApplication!, didReceiveLocalNotification notification: UILocalNotification!)
但是当我尝试访问其中一个打开的ViewControllers时,我认为它返回null,因为我的应用程序正在崩溃.这是我正在尝试的:
var rootViewController = self.window!.rootViewController
var storyBoard = rootViewController.storyboard
var setViewController = storyBoard.instantiateViewControllerWithIdentifier("CurrentShows") as ViewController_CurrentShows
rootViewController.navigationController.popToViewController(setViewController, animated: false)
setViewController.reloadData()
它在popToViewController行崩溃了.
我是新来的iOS 迅速和swrevealviewcontroller。我面临一个问题!在我的幻灯片菜单中(场景TableViewController,有两个蓝线绘制),在选中时,每行然后应打开粒子scene(视图控制器),但是不幸的是它没有打开。didselectRowAt当我从表中选择行但pushViewController不起作用时,没有错误和火灾。
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let dvcStoryBordId = menuViewIds[(indexPath.row - 1 )]
        let viewController = storyboard?.instantiateViewController(withIdentifier: dvcStoryBordId )
        self.navigationController?.pushViewController(viewController!, animated: true)
    }
故事板
我想念什么吗?这是正确的方法吗?自。
更新:
self.navigationController是nil。还有其他选择吗?或没有导航
更新:
情节提要ID
menuViewIds = ["shareWithFriends","deliveryTracking", "controls", "support","myAccount"]
运行时视图