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.navigationController是nil。还有其他选择吗?或没有导航
更新:
情节提要ID
menuViewIds = ["shareWithFriends","deliveryTracking", "controls", "support","myAccount"]
Run Code Online (Sandbox Code Playgroud)
运行时视图
尝试这个:
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)
| 归档时间: |
|
| 查看次数: |
8264 次 |
| 最近记录: |