Ty Kroll
Ty Kroll

Reputation: 1395

Pop/push view under modal

I have a modal view that slides up covering the visible view. Based on button presses on the modal, I'd like to pop the view it covers and push a different view so when the modal slides down again the new view is visible.

What are so strategies to accomplish this?

Upvotes: 0

Views: 518

Answers (1)

rishi
rishi

Reputation: 11839

From the navigation controller stack you can access previous view controller, and on action you can change the view of that controller, use something like -

NSMutableArray *activeControllerArray =  [self.navigationController.viewControllers mutableCopy];
// Replace your earlier view controller/view with new view controller/view , and then assign again the navigation controller's viewControllers

self.navigationController.viewControllers = activeControllerArray;

Upvotes: 1

Related Questions