我正在尝试使用第二个故事板和UISplitViewController
来修改iPad的iPhone应用程序。我想重用iPhone视图控制器,但是已经更改了调用视图的顺序。如何重新构建viewControllers的加载顺序,以及UISplitViewController
如何工作的典型当前顺序?
iPhone查看流程 TableView / MasterViewController> DetailViewController
iPad查看流程
细节ViewController> TableView/MasterViewController
> SplitViewController
以上是调用这些类的viewDidLoad()
方法的顺序。
App委托文件:
if (UIDevice.currentDevice().userInterfaceIdiom == .Phone){
print("iPhone style UI")
}else{
print("iPad style UI")
IPAD = true
var mainView: UIStoryboard!
mainView = UIStoryboard(name: "Storyboard2", bundle: nil)
let splitViewController = mainView.instantiateViewControllerWithIdentifier("initial") as! UISplitViewController
let leftNavController = splitViewController.viewControllers.first as! UINavigationController
masterSplitViewController = leftNavController.topViewController as! MainViewController
detailSplitViewController = splitViewController.viewControllers.last as! DetailsIpad
detailSplitViewController.meeting = Meeting.init()
self.window!.rootViewController = splitViewController
//let splitViewController = self.window!.rootViewController as! UISplitViewController
}