我刚刚在我的应用程序中实现了SWRevealViewController
,我遇到了一个问题。
front view
(表格视图顶部的视图)不是我想要的视图控制器。我从表格视图链接到two view controllers
,我不想显示的那个显示出来。
如何在启动应用程序时在前面设置我想要的两个视图控制器之一?
答案 0 :(得分:1)
let frontNavigationController:UINavigationController
let rearNavigationController:UINavigationController
let revealController = SWRevealViewController()
var mainRevealController = SWRevealViewController()
let sidebar = self.storyboard?.instantiateViewController(withIdentifier: “sideVCID”)as! Sidebar
let home = self.storyboard?.instantiateViewController(withIdentifier: "HomeVCID")as!HomeVC
frontNavigationController = UINavigationController(rootViewController: home);
rearNavigationController = UINavigationController(rootViewController: sidebar)
revealController.frontViewController = frontNavigationController;
revealController.rearViewController = rearNavigationController;
revealController.delegate = self;
mainRevealController = revealController
self.window?.rootViewController = = mainRevealController