How do you pop a modal view and the previous navigation controller view at once?

Posted by mr_kurrupt on Stack Overflow See other posts from Stack Overflow or by mr_kurrupt
Published on 2011-11-12T23:41:01Z Indexed on 2011/11/13 1:51 UTC
Read the original article Hit count: 289

I haven't found anything similar to this on google or stack overflow...

What I'm trying to do is pop a modal view and the previous view at the same time. For example, look at the calendars app. When you are on the 'Edit' screen and select 'Delete Event', you are taken back to the calendar view. The 'Edit' screen, which was presented modally is popped as well as the the 'Event' screen (where the user is just viewing the calendar event). The problem I am having is that I know how to pop a modal view...but from the same UIViewController subclass ('Edit' screen in this example), how do I pop a view that isn't modal?

I was thinking about popping the modal view as you would normally, then posting an NSNotification to the 'Event' (for instance) screen's UIViewController subclass and telling it to pop that view as well.

The other thing is that for the animation, it should be the dismissModalViewControllerAnimated animation (slide down) and not the popViewControllerAnimated animation (slide left).

Thanks.

© Stack Overflow or respective owner

Related posts about uinavigationcontroller

Related posts about modalviewcontroller