Chapter 2. Views and view controller basics
This chapter covers
- Enhancing your Hello Time app
- Views and the view coordinate system
- User interface controls and responding to events
- View controller lifecycle and creating views programmatically
- Supporting multiple orientations
You’ve all used apps on your mobile devices. The way you interact with them is much different than the way you use apps on your laptops or desktop computers. Why is that? The amount of space available to present information on mobile screens is much smaller than on desktop applications. Only a limited amount of data can be displayed on the screen at once to ensure a good visual experience.
You also interact with your apps differently. Instead of using peripherals such as a keyboard and mouse as input devices, you use your fingers. The appearance and design should feel natural to users. You should take all of this into account when creating and designing the views that make up your apps.
In this chapter we’ll go over the different parts of what you see in an app—its windows, its views, and the view controllers that manage them. You’ll learn about the different controls you can use within each view of your app, such as buttons, labels, and text fields. You’ll then learn how to visually arrange and organize the views within your application, better known as storyboarding. First, we’ll revisit the Hello Time app you created in chapter 1 and add more functionality to it.