Day 3
How does the app work?
- An app is composed of objects that can send messages to each other.
- Most of the objects are provided by the iOS, example UIButton, UIAlertController, etc.
- The remaining objects are created by us, for example, ViewController.
- In iOS, apps are event-driven.
Portrait vs Landscape
- In iOS, screen dimensions are measured in points. In older devices, 1 point = 1 pixel. Right now the plus devices had 1 point = 3 pixels.
- To change the orientation of our app to landscape – Click on BullsEye in project navigator -> Select BullsEye in Target part -> In the general area, scroll down to the Device Orientation and uncheck portrait. Now run the app, the app stays in landscape mode even when we rotate the device.
Adding all UI Elements
Next, I added all the UI elements of the app on the screen using the objects of UIKit.