Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISplitViewController - Pushing Modal View

What is considered the best practise when pushing a modal view when using a UISplitViewController? Would you push from the RootViewController, the DetailViewController or directly from the Application Delegate?

Ideally the functionality I am trying to achieve is to have the modal view controller displayed as soon as the UISplitViewController is loaded based on certain conditions.

Thanks in advance for any pointers on this matter.

like image 288
Mick Walker Avatar asked Nov 15 '22 09:11

Mick Walker


1 Answers

I was trying to do the exact same thing, and I've come up with the following answer: it's simpler to do it from the App Delegate.

In Portrait mode, the RootViewController is created in a strange way (popover) so it's not practical, the Application Delegate ensures your view will show properly in all cases. I can't remember what was the issue with doing it in the DetailViewController though.

EDIT: the actual implementation in application:didFinishLaunchingWithOptions: is something like that: [splitViewController presentModalViewController: modalViewController animated: NO];. Hope this helps!

like image 60
jv42 Avatar answered Dec 30 '22 09:12

jv42