开发者

How can I dismiss a pushViewController in iPhone/iPad?

开发者 https://www.devze.com 2023-01-25 05:44 出处:网络
I need to make a button to dismiss the child view controller from a pushViewController. The action is exactly like the left (back) button on the top navigation bar.

I need to make a button to dismiss the child view controller from a pushViewController. The action is exactly like the left (back) button on the top navigation bar.

How can I开发者_运维问答 dismiss a pushViewController? Which method should I use ?

Thanks.


UINavigationController's popViewControllerAnimated: method should do it.


In my case where [self performSegueWithIdentifier:@"showAllContacts" sender:self]; pushes a new ViewController, in order to close(dismiss) that view controller which has been pushed I use:

[self.navigationController popViewControllerAnimated:YES];

This is called for a custom button which I added to the navigation bar!

0

精彩评论

暂无评论...
验证码 换一张
取 消