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.

UITabViewControllers in Swift Playgrounds

UITabViewControllers in Swift Playgrounds

From the course: iOS Development Tips

UITabViewControllers in Swift Playgrounds

- [Instructor] Prototyping in Swift playgrounds is a great way to start working on a new project. Use tab bar controllers in your playground to switch easily between view controllers instead of using pages. Let me show you how to add a tab bar controller to a playground. In the exercise files, I've made for you two view controllers. If you go to the bottom of the code, you'll see I've set the live view here to show ViewControllerOne which I'm running here. I can change to vc2 to show the second ViewController. And I'll run that. And I get my second ViewController. For tab bar controller, what we're going to do is this, I'm going to go just below the two ViewControllers and I'm going to add the following. Let tabBarVc, for tab bar controller and I'm just going to make an instance of UITabBarController. Now, the UITabBarController has an array of view controllers which contains the controllers in the order they show on…

Contents