Created
August 11, 2023 12:19
-
-
Save MuazzezA/10178ce3d5428a5d14b6d0eddad73231 to your computer and use it in GitHub Desktop.
Simple code to understand the lifecycle of UIControllerView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
print("view did load") | |
} | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
print("-----") | |
print("view will appear") | |
} | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
print("view did appear") | |
} | |
override func viewWillDisappear(_ animated: Bool) { | |
super.viewWillDisappear(animated) | |
print("view will disappear") | |
} | |
override func viewDidDisappear(_ animated: Bool) { | |
super.viewDidDisappear(animated) | |
print("view did disappear") | |
} | |
@IBAction func removeViewButtonAct(_ sender: Any) { // connect to button | |
print("-----") | |
print("remove view") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment