最新版的在iWatch2.0中的點擊Glance自定義的界面跳轉web
到今天爲止(2015年11月20日)的官方給出的方法是:app
當你的手錶app上顯示的快速信息瀏覽界面(Glance界面的時候),若是用戶點擊了這個界面,默認是跳轉到手錶app的主界面(也就是默認的InterfaceController界面的),但當你須要從新定義這個過程,但願能夠跳轉到你指定的界面的時候,按照下面的步驟:code
在Glance控制器中:orm
例如:it
- (void)willActivate { // This method is called when the controller is about to be visible to the wearer. NSLog(@"%@ will activate", self); // Use Handoff to route the wearer to the image detail controller when the Glance is tapped. [self updateUserActivity:@"com.example.apple-samplecode.WatchKit-Catalog" userInfo:@{@"controllerName": @"imageDetailController", @"detailInfo": @"This is some more detailed information to pass."} webpageURL:nil]; }
在主控制器(InterfaceController)io
- (void)handleUserActivity:(NSDictionary *)userInfo { // Use data from the userInfo dictionary passed in to push to the appropriate controller with detailed info. [self pushControllerWithName:userInfo[@"controllerName"] context:userInfo[@"detailInfo"]]; }
好了,你再次運行試試看吧。form