518 B
518 B
title |
---|
View Controllers |
View Controllers
This is an example of what a basic view in Swift looks like.
import UIKit
class ViewController: UIViewController {
// 1
override func viewDidLoad() {
// 2
super.viewDidLoad()
// 3
view.backgroundColor = .white
}
}
- Loads view after the controller loads.
- Overrides the UIViewController class. This is a necessary step for any view controller.
- Sets background color to white.