iOS Storyboard-Exit

Target

本篇主要是說明 storyboard 中 UIViewController

A -> B -> C
如何透過 Exit 來達到以下的目的
C -> A

Action Items

  1. Add unwind IBAction - (A ViewController)
  2. Exit action - (C ViewController)

Quick Start

Add unwind IBAction

在A ViewController 中,加入以下 function

1
2
3
- (IBAction)unwindSegueToAViewController:(UIStoryboardSegue *)segue {

}

To 後面的名稱為此 ViewController 的名稱,
這樣透過 action 看到此方法時,就可以明確地知道,
要回到哪個 ViewController。

Exit action

  1. 開啟 storyboard
  2. 在 A ViewController 上面,使用右鍵點擊 Exit,可以看到剛剛加的 IBAction
  3. 將 step 2 中的 IBAction 與 C ViewController 中,要觸發此返回的 button 連結

Reference

http://blog.csdn.net/kid_devil/article/details/23218195

文章目录
  1. 1. Target
  2. 2. Action Items
  3. 3. Quick Start
    1. 3.1. Add unwind IBAction
    2. 3.2. Exit action
  4. 4. Reference
,