Kris Wong
07/31/2019, 6:08 PMview
on the view controller will load the view and run viewDidLoad
Sam
07/31/2019, 6:51 PMview
will run through the following sequence.
1. loadViewIfNecessary()
2. loadView()
3. viewDidLoad()
The best place to customize your view controller's view hierarchy is in loadView()
. Be sure to call super
first. Any configuration of the views should happen in viewDidLoad()
. Note that your vc isn't actually attached to another view controller or window at this point so definitive size information is not available. Size customizations should be done in UIContentContainer
overrides.viewIfLoaded
nullable property if you want the view but don't want to trigger loading. It is available in iOS 9.0+Kris Wong
07/31/2019, 6:56 PMperformSelector
throws an error stating the selector is unrecognized, but I know it's valid, and it works fine just running the app.Sam
08/01/2019, 12:46 PMKris Wong
08/01/2019, 12:59 PMSam
08/01/2019, 1:15 PMKris Wong
08/01/2019, 1:20 PMUIApplication.sharedApplication
is null (UIApplicationMain
wasn't run, and can't be run)