I believe that i found a typo in the code> if let detailViewController = self.delegate as? DetailViewController { splitViewController?.showDetailViewController(DetailViewController, sender: nil) }
Shouldn’t it be showDetailViewController(detailViewController, sender: nil) instead?
DetailViewController vs detailViewController
There is a logic bug in the code, calling the view controllers in the app delegate does not guarantee that the view hierarchy is being loaded since no view has been referenced. So on my Xcode 7.3/iOS 9.3 the detail page does not refresh correctly unless I add
Thanks for this great tutorial. I have a question about having the app launch into the master view controller when on iPhone. I can get this working by setting the split view’s delegate and then calling the delegate method
Just a heads up that this project won’t compile after recent Swift changes. In particular, the init method of the MasterViewController fails with an error of "A non-failable initializer cannot chain to failable initializer ‘init(coder:)’ written with ‘init?.’
Found a couple conflicts with the newer swift xcode release in that you need to write the init coder part as ‘required init?’ with a question mark or else you get an error and possibly add an exclamation mark somewhere in the Tableview DidSelectRow part. The other thing I noticed was that the constraints need work for when the ipad is in portrait mode the Tableview on the left blocks the detail view content from being displayed. Good tutorial though.
Anyone having any luck using this in Swift? I can get it to compile but the Detail view does nto update. I even downloading the completed project and tried to update the Syntax and the same thing happened.
How would this setup work if you needed to reuse the UISplitViewController elsewhere in the application? By this I mean there could be need to load a different master view controller with associated (perhaps multiple) detail view controllers.
In my opinion - and I could be wrong - it would be better to have the master view controller instantiate and push 1 or more view controllers into the detail view controller.
This way you can create delegates in the detail view controller(s) (as opposed to doing it in the master) and make the master implement these delegates to handle requests from detail view controllers. In this setup, the master view controller plays a central role in linking to one or more detail view controllers and it becomes easier to conditionally select what detail view controller to display. Let me know your thoughts on this.
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]