I’m not sure why this is happening, but in the App delegate, I’m setting a viewcontroller as the root and presenting a ModalViewController in front of it. The strange thing is that the viewcontroller behind the modalviewcontroller is still loading even though it does not appear. Is this normal? Is there a way to prevent the viewcontroller behind the modalviewcontroller to load?
Thank you
I am not sure exactly what you mean by “loading.” As long as the view controller in the background is the parent view controller of the modal view controller, it is going to need be initialized before the modal view controller can be displayed at all. In that sense, it must be loaded.
If, on the other hand, you mean that the contents of the background view controller are visually displayed and then, afterwards, the model view controller appears on top of it—but you don’t want the contents of the background controller to be seen until after the modal view controller is dismissed—then one possibility would be to set the
hiddenproperty toYESand unhide the contents when modal view controller is dismissed. To do that, I would make the background view controller a delegate of the modal view controller, so it receives a callback when the modal view controller is dismissed.