I am making a Apple Watch app and I'd like to set different root view controllers, depending on an initial condition.
I cannot set the WatchKit rootInterfaceController directly though, because it is a readonly property, but by checking Apple documentation, they say it is possible to set it "before the launch sequence finishes".
Do you have a good suggestion to do that? Maybe through the storyboard?
You can't set 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 that you need, after track present some controllers, for example
if !isCounting {
self.presentControllerWithName("Interface", context: nil)
} else {
self.presentControllerWithName("Timer", context: nil)
}
isCounting
is stored in NSUserDefaults
hope this will help :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With