Is there any way that I could see a view is loaded without checking the source code of that view controller (e.g., viewDidLoad, viewWillAppear, etc.)
or how can I check at the run time / dynamically if any view is loaded to grab the subviews.
The difference between viewDidAppear and viewDidLoad is that viewDidAppear is called every time you land on the screen while viewDidLoad is only called once which is when the app loads.
Swift version: 5.6. The override is used when you want to write your own method to replace an existing one in a parent class. It's used commonly when you're working with UIViewControllers , because view controllers already come with lots of methods like viewDidLoad() and viewWillAppear() .
Creates the view that the controller manages. iOS 2.0+ iPadOS 2.0+ Mac Catalyst 13.0+ tvOS 9.0+
viewDidLoad is called when the ViewController has loaded its view hierarchy into memory. This is the point where you can perform your customized initialisation for your view controller. For instance, if your view controller has a UILabel and you want to set a custom text to it, this is the point where you do that.
If you have an instance of a view controller, you can ask it:
viewController.isViewLoaded
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With