Rahul
Rahul

Reputation:

Is there anyway to show View without pushing it to Nav Controller

I've a question, I want to show a View with out Pushing it to nav controller, it is very similar as with Native email UI, you go to Inbox folder and there you select "Compose" screen, compose screen is just animate from bottom to up without pushing this screen to nav controller.

How can i do the same thing?

Thanks for your time and help

Upvotes: 1

Views: 356

Answers (3)

Corey Floyd
Corey Floyd

Reputation: 25969

As Daniel was hinting to, presenting modal views is a UIViewController behavior, UInavigationController just inherits this from its superclass.

There is no need to have a UINavigationController to get this effect.

Upvotes: 0

Daniel Dickison
Daniel Dickison

Reputation: 21882

You can show any view controller as a "modal" view on top of the current nav/tab view controller, e.g.:

[self.navigationController presentModalViewController:anotherViewController animated:YES];

This gives you the "slide in" animation for free. You do need to arrange for the dismissModalViewControllerAnimated: to be called on the nav controller when you're done with the modal view, though. See the reference for UIViewController

Upvotes: 2

Eric Petroelje
Eric Petroelje

Reputation: 60498

Sure, just add it as a subview of your window rather than pushing it to the nav controller.

Upvotes: 1

Related Questions