- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
[WKInterfaceController reloadRootControllersWithNames:@[@"pageOne", @"pageTwo"] contexts:nil];
}
Following Apple's guidelines
Call this method to reload the pages in your app’s page-based interface. At launch time, you use this method to customize the set of pages you want displayed.
at launch time, only results in a loop. With each reload calling awakeWithContext or will Activate or init again and again.
Is there a better way to go about reloading the Page-Based app on launch with a loop occurring?
That is why awakeWithContext:
exists. The first time your app is launched, the initial controller is passed nil
as context
. But if you reloadRootControllersWithNames:contexts:
, you have an opportunity to pass a custom context instance and thus distinguish the launch mode.
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