Author Topic: How do I dismiss a view that has been pushed by a Navigation Controller?  (Read 2139 times)

kjmcneish

  • Administrator
  • *****
  • Posts: 719
    • View Profile
If you need to dismiss a view controller that has been pushed by a navigation controller (rather than simply using the Back button), use this code:

Swift:
Code: [Select]
self.navigationController?.popViewControllerAnimated(true)
Objective-C:
Code: [Select]
[self.navigationController popViewControllerAnimated:YES];
All the best!
Kevin McNeish
Author of "Learn to Code in Swift": https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
« Last Edit: July 20, 2015, 04:17:29 AM by kjmcneish »