pushViewController不起作用

cri*_*ika 5 ios swrevealviewcontroller swift

我是新来的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)
    }
Run Code Online (Sandbox Code Playgroud)

故事板

在此处输入图片说明

我想念什么吗?这是正确的方法吗?自。

更新:

self.navigationControllernil。还有其他选择吗?或没有导航

更新:

情节提要ID

menuViewIds = ["shareWithFriends","deliveryTracking", "controls", "support","myAccount"]
Run Code Online (Sandbox Code Playgroud)

运行时视图

在此处输入图片说明

Vik*_*wal 1

尝试这个:

   func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

         let dvcStoryBordId = menuViewIds[(indexPath.row - 1 )]
         let viewController = storyboard?.instantiateViewController(withIdentifier: dvcStoryBordId )
         var navigationController = UIApplication.sharedApplication().keyWindow?.rootViewController as! UINavigationController
         navigationController?.pushViewController(viewController!, animated: true)

   }
Run Code Online (Sandbox Code Playgroud)