Install rootInterfaceController in Apple Watch "ExtensionDelegate"

I am making an Apple Watch application, and I would like to install different root view controllers depending on the initial condition.

I cannot install WatchKit rootInterfaceController directly because it is a readonly property, but, checking Apple's documentation , they say that it is possible to set it "before the startup sequence is complete."

Do you have a good suggestion to do this? Maybe through a storyboard?

+7
ios apple-watch storyboard
source share
1 answer

You cannot set a read-only property, you can do something like

Create some SplashController with some splash screen and in awakeWithContext

  override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) } 

track something you need after some controllers present the track, for example

  if !isCounting { self.presentControllerWithName("Interface", context: nil) } else { self.presentControllerWithName("Timer", context: nil) } 

isCounting is stored in NSUserDefaults

hope this helps :)

+1
source share

All Articles