1
votes

How can I present a UINavigationController with navigation bar like a popover on iPhone using custom UIViewController transitions introduced in iOS 7? I accomplished this with a standard UIViewController and transition animator:

http://www.bytolution.com/Screenshot%202013.11.02%2015.25.34.png

When trying the same with UINavigationController instead, this is the result:

http://bytolution.com/Screenshot%202013.11.02%2015.27.10.png

At WWDC session 218 (login required) an Apple engineer made a demo of the exact thing I am trying to achieve:

http://bytolution.com/Screen%20Shot%202013-11-03%20at%2013.50.17.png

Unfortunately I could not find the sample code anywhere.

If you want to take a look at my code visit Github.com/bytolution/Apsiape

Thanks in advance!

3
Make a custom navigation bar, not a real oneMutawe

3 Answers

1
votes

I would take a look at WYPopoperController which does what you want on iPhone: https://github.com/nicolaschengdev/WYPopoverController

0
votes

iPhone does not support the UIPopoverController class and all Modal transitions are full screen. Yet obviously the screen shot you showed exists.

Any view controller can have its view extracted and shown within another view. That is what's been done there. A black view is placed over the background with 30% opacity and the "popover" view is added on top of that. For added effect, a tap gesture recognized can be added to the black masking view to dismiss the popover when the user taps off of it.

0
votes

I finally figured out how to do it on my own. I refined my Google search and found the trick to be an embedded UINavigationController. This was also useful for custom view controller transitions as it works nicely. You might want to check out this stackoverflow.com question.

If you need the code, it's in my project on GitHub.