Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class PrintingViewController: UIViewController {
// Load
override func loadView() {
super.loadView()
print("lifecycle", #function)
}
override func viewDidLoad() {
super.viewDidLoad()
print("lifecycle", #function)
}
// Layout
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
print("lifecycle", #function)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
print("lifecycle", #function)
}
// Appear
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print("lifecycle", #function)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("lifecycle", #function)
}
// Disappear
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
print("lifecycle", #function)
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
print("lifecycle", #function)
}
deinit {
print("lifecycle", #function)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment