简体   繁体   中英

Don't Understand the concept of the pushViewController

Can Anyone explain me the concept of Pushing and Popping Stack Items in UINavigationController .I only know the meaning of the Push and Pop that used in stack opreation in Data Structure but Don't know how it work in UINavigationController .Please also explain the the following functions of it.

pushViewController:animated:

- popViewControllerAnimated:

- popToRootViewControllerAnimated:

- popToViewController:animated:

interactivePopGestureRecognizer

Thanks.

Its the same concept as a stack in a data structure really, except you can only view whats on the top (ie the top viewcontroller in your navigation stack)

so pushing a viewcontroller means its going on top of the stack (animates coming in from the right) popping a viewcontroller will take a viewcontroller off the top (which is the current one you are looking at) so it will animate off the right of the screen, showing the viewcontroller that was underneath the top one

popToRootViewController is effectively just popping until you hit the very last viewcontroller in your navigation stack

popToViewController pops until a particular viewcontroller is on the top

Hope thats all the clarification you need

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