Pushing and Popping View Controllers

Add new items onto the navigation stack by pushing a new controller with pushViewController:animated:. Each view controller provides a navigationController property. This property points to the navigation controller that this controller is participating in. The property is nil if the controller is not pushed onto a navigation stack.

Use the navigationController property to push a new view controller onto the navigation stack and call the push method on the navigation controller. When pushed, the new controller slides onscreen from the right (assuming that you set animated to YES). A left-pointing Back button appears, leading you one step back on the stack. The Back button uses a chevron along with the title ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.