From the course: iOS Lean Controllers: 2 Controls, Views, Extensions, and Networking

Unlock this course with a free trial

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

Creating base TabBarController

Creating base TabBarController

- [Instructor] And welcome back. In this last part, we're going to see how we can move all of the functionality in a common place. And that common place will be the base tab bar controller. So let's go ahead and add a new file, and just for the sake of simplicity, I'm just gonna call it BaseTabBarController. The whole point of adding a base tab bar controller is so that we can get access to the tab bar selecting items and then we can take some actions on it. So import UIKit. Class BaseTabBarController which inherits from UITabBarController. We don't really need any code in that so I'm just gonna move this on this line. We do want to extend the BaseTabBarController so extension BaseTabBarController UITabBarControllerDelegate and over here now we are interested in should select or should not select delegate method of the TabBarControllerDelegate. So should, oops. Should, not sure why it's not coming. Here we go shouldSelect. So shouldSelect is basically it's gonna return true or false…

Contents