Reputation: 5426
In my app I show a view by this code
[self.view addSubview:view2];
now i want to call the original view from a button (in view2).
thank you.
Upvotes: 0
Views: 92
Reputation: 10870
You can do it by removing the view2. i.e
[view2 removeFromSuperview];
An alternative is to use Navigation Controller or simply present Modal View
// present on top of the current view
[self presentModalViewController:viewController2 animated:YES];
on second view controller's button tap event
// remove and back to previous view
[self dismissModalViewControllerAnimated:YES];
Upvotes: 1