Borut Tomazin Borut Tomazin - 4 months ago 25
iOS Question

Force viewDidLoad to fire on iOS

I have two window app and while I present first window I would like the view in second window to load and prepare content for later in background.

I've tried to use method

loadView
but Apple says you should not call this method directly.

So far I've chosen to use the view's method
userInteractionEnabled
which actually implicitly
calls
viewDidLoad
method.

Is there an elegant way to force
ViewControllers
viewDidLoad
method to fire before it should naturally (when window is key and presented)?

Answer

You can just call [viewController view];.

Comments