如何在apple Watch中使用performSegueWithIdentifier?

时间:2015-03-23 21:26:25

标签: apple-watch

我一直使用功能[self performSegueWithIdentifier:@"changeView" sender:self];

有人可以说苹果手表的效果如何?

2 个答案:

答案 0 :(得分:1)

WKInterfaceController向您展示如何将segues与标识符一起使用 (contextForSegueWithIdentifier :)但我认为最好用的是" presentControllerWithName:context:"和" pushControllerWithName:context:",您可以从Interface Builder为视图指定名称;当你试图从控制器创建一个segue到欲望视图时,通常会创建一个页面,你需要为这个动作创建一个按钮,使用我之前告诉你的方法,你不需要要在IB上创建segues,只需识别视图及其即可。

答案 1 :(得分:0)

如果您使用的是表格,则可以在watchOS 3中使用table.performSegue(forRow: 0)。否则,您必须使用pushControllerWithName:context:presentControllerWithName:context: