11
9

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.

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)

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

#参考
https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceController_class/index.html

#コード
https://github.com/gladenjoy/changeInterface

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?