The main view of my app is a UIImagePickerController camera view. When the app becomes active (in didBecomeActive), I present a modal view controller that shows some settings generated from a network request. (Note that for debugging purposes, I took the network request out and am currently just showing a dummy view)
The modal view animates in smoothly, but after loading it freezes for 3 seconds then responds normally. After dismissing the view (also animates smoothly), my image picker controller pauses for 2 seconds then resumes normally.
I have removed all functionality from the modal view controller to make sure there was no operations clogging the main thread. I am presenting the most basic of controllers, and still get the choppy ui. I would suspect that this is from my presenting view controller calling viewDidLoad/Unload or something similar, but my search did not give me any information on what delegate methods are called in the presenting view controller when a modal view is shown.
My problem can be solved by answering:
- What delegate methods are called in the presenter when a modal view is shown?
- (If any ^) How can I not call those methods, or make them run smoother?
- What common pitfalls are associated with modal view controllers?
presentViewControllerAnimated:completion:
is the only thing in my main view controller'sdidBecomeActive
function. There is a lot of initializations in my viewDidLoad and a lot of deallocations in viewDidUnload... which is why I'm trying to ignore these while presenting the modal view controller – user