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.

Create navigation controllers

Create navigation controllers

From the course: iOS Development Tips

Create navigation controllers

- [Instructor] Not everyone loves a storyboard. With playgrounds, you can't use the storyboard. Often storyboards make for less portable code. Making user interfaces in code solves all these problems. If you do, you may need navigation controllers in code. Let me show you how to create navigation controllers both in playgrounds and in an Xcode project. In the downloads example file, I embedded a playground into an Xcode project so we can look at both projects and playgrounds. Open up the playground. It's two view controllers, yellow and blue, connected through a BarButtonItem. In the action of the BarButtonItem, I'll make some code to navigate from the yellow controller to the blue controller. I'll first add an instance of the controller. Let bvc = BlueViewController and then I'll use the pushViewController method to show the BlueViewController. So for this, I'm going to put navigationController and that has the method pushViewController and the view controller that I'm going to push…

Contents