LoginSignup
11
9

More than 5 years have passed since last update.

AppleWatchアプリでコードから画面遷移する方法

Last updated at Posted at 2015-01-30

AppleWatch向けアプリでセグエを使わずにコードからInterfaceを遷移させる方法.

1.StoryBoardに遷移先のInterface Controllerを用意

スクリーンショット 2015-01-30 17.47.13.png

分かりやすい様にLabelでinterface2と書いておく.

2.用意したInterface ControllerのIdentiferを設定

スクリーンショット 2015-01-30 17.48.20.png
今回は「Interface2」とする.

3.呼出したい所で

- pushの場合

InterfaceController.swift
pushControllerWithName("Interface ControllerのIdentifer", context: nil)

- modalの場合

InterfaceController.swift
presentControllerWithName("Interface ControllerのIdentifer", context: nil)

でセグエを使わず画面遷移可能.

参考

コード

11
9
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
11
9