Loaded and Appearing Views

Now that you have two view controllers, the lazy loading of views mentioned earlier becomes more important. When the application launches, the tab bar controller defaults to loading the view of the first view controller in its array, which is the temperature conversion view controller. The map view controller’s view is not needed and will only be needed when (or if) the user taps the tab to see it.

You can test this behavior for yourself. When a view controller finishes loading its view, viewDidLoad() is called, and you can override this method to make it print a message to the console, allowing you to see that it was called.

You are going to add code to both view controllers. However, there is no code ...

Get iOS Programming: The Big Nerd Ranch Guide, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.