خرید بک لینک

Vote count: 1

I'm trying to adapt an iPhone application for iPad using a second storyboard and a UISplitViewController. I'd like to reuse the iPhone viewcontrollers but the order in which the views have been called has been changed. I'd like to restructure this order and understand why it has been changed.

iPhone View Flow : TableView/MasterViewController > DetailViewController

iPad View Flow: Detail ViewController > TableView/MasterViewController > SplitViewController

The above is the order in which the viewDidLoad method for these classes are called. Is the order in which these ViewControllers are being initiated normal behavior and how can I change this order? Using the existing iPhone code results in the DetailViewController trying to use variables that have yet to be initialized as it is not normally called before the meeting class.

enter image description here

App Delegate file:

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

       }

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 13 خرداد 1395 ساعت: 18:33

صفحه بندی