Skip to content

Instantly share code, notes, and snippets.

@tdtsh
Created January 17, 2016 13:00
Show Gist options
  • Save tdtsh/2154c3b79bac6fbebfd8 to your computer and use it in GitHub Desktop.
Save tdtsh/2154c3b79bac6fbebfd8 to your computer and use it in GitHub Desktop.
Swift2で NavigationController の子ウィンドウ閉じるとき2画面前に遷移させる
class ThirdViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// 1つ前のViewControllerを遷移リストから削除
let parentIndex = (self.navigationController?.viewControllers.indexOf(self))! - 1
self.navigationController?.viewControllers.removeAtIndex(parentIndex)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment