msk*_*msk 14

您无法获得任何WKInterface UI元素的状态,如按钮(WKInterfaceButton)标签(WKInterfaceLabel)等.我认为这是Apple设计的,因为它涉及iOS设备上运行的扩展和手表之间的通信应用.为了节省这种开销,没有getter,扩展应该跟踪状态变化(它可以改变状态).

  • @progrmr来自[docs](https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceButton_class/index.html):不要自己子类或创建此类的实例 (3认同)
  • 您也可以将WKInterfaceButton子类化,并添加setTitle和支持实例变量。 (2认同)