47
46

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[swift]unwind segueを設定する

Posted at

久々にStoryboardをいじっていたら、すっかり忘れてはまったのでメモ。

Cancelボタンを押して前の画面に戻る

子画面から戻る遷移をつけたい場合、Storyboard上でCancelボタンをExitへCtrl+ドラッグする。

kobito.1415320044.458358.png

が、なぜか上の図のように、Exitボタンにドロップできない!!!

と思っていろいろ調べたら、先に親画面のクラスに、unwindのコードを追加しなければいけなかったらしい。

@IBAction func unwindToTop(segue: UIStoryboardSegue) {
}

ドロップできました。めでたしめでたし。

47
46
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
47
46

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?