简体   繁体   中英

navigation back button method

I'm working with an iOS application and I want to artificially induce the action of the "back" button in a navigation bar through other events or button presses. Is this possible, and if so what methods are there to allow me to do this?

I'm assuming that you're using a navigation controller and that it's functionality is what you want to emulate. In that case, you can directly access it (every view controller has a link to its navigation controller) and ask it to pop the current view controller from the top of the stack:

[self.navigationController popViewControllerAnimated:YES];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM