最新版的在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