problem reason: wrong method name
Viewcontroller lifecycle
1 // This method is called when the view is loaded
2 override func loadView() {
3 super.loadView()
4 print("Loading the view")
5 }
6
7 // Call this method when the loaded view is finished
8 override func viewDidLoad() {
9 super.viewDidLoad()
10 print("End of loading view")
11 }
12
13 // Call this method when the view is about to be displayed
14 override func viewWillAppear(_ animated: Bool) {
15 super.viewWillAppear(animated)
16 print("The view is about to be displayed")
17 }
18
19 // Call this method when the view is already displayed
20 override func viewDidAppear(_ animated: Bool) {
21 super.viewDidAppear(animated)
22 print("The view has been displayed")
23 }
24
25 // Call this method when the view is about to disappear
26 override func viewWillDisappear(_ animated: Bool) {
27 super.viewWillDisappear(animated)
28 print("The view is about to disappear")
29 }
30
31 // Call this method when the view has disappeared
32 override func viewDidDisappear(_ animated: Bool) {
33 super.viewWillDisappear(animated)
34 print("The view has disappeared")
35 }
36
37 // This method is executed when a memory warning is received
38 override func didReceiveMemoryWarning() {
39 super.didReceiveMemoryWarning()
40 }
Similar Posts:
- [How to Solve] Xcode:No such module SwiftyJSON
- Python uses decorator and reports error typeerror: ‘nonetype’ object is not callable ‘
- How to Solve Critical dependency: the request of a dependency is an expression?
- Xlua#: How to Call C
- Android WebView monitors and rewrites window.history.go (- 1) method call
- [Solved] Vue3 wow.js Error: Cannot set property ‘getPropertyValue’ of undefined
- @Override must override a superclass method problem solving
- JavaScript Uncaught TypeError: Cannot set property ‘innerHTML’ of null”
- Python: __ new__ Method and the processing of typeerror: object() takes no parameters