From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Add a split-view controller programmatically

Add a split-view controller programmatically

From the course: iOS Development Tips

Add a split-view controller programmatically

- [Instructor] An often ignored but rather powerful view controller is the split-view controller. You can make one from a template and the storyboard, but I often skip both and do it programmatically, which is especially good when I'm prototyping in a playground. Let's give it a try using the exercise files that have been used in the past few tips. Now there I added a color table. Now split-view controllers have a master which I'll make this color table, and the detail which will tell us the color name and show the color. Head over to the app delegate in this project. Split-view controllers should be your root view, and you should have two view controllers be the roots for the detail and master view. I usually embed the root-view controllers and navigation controllers so I can add view controllers off that. If you look at our code here, I'm going to clean some of this up here, you can see that I already did that for the first one here, which we originally called navigation view…

Contents