[英]How to update/refresh an Apple Watch Interface Controller?
I'm looking for a way to update/refresh the Interface Controller in watchkit. 我正在寻找一种更新/刷新watchkit中的Interface Controller的方法。
Many iPhone apps employ a 'pull to refresh' or sometimes a way to reload the whole screen in a time bound manner. 许多iPhone应用程序都采用“拉动刷新”或有时以限时方式重新加载整个屏幕的方法。 I'm looking for something similar for Apple Watch, but can't find an appropriate function.
我正在为Apple Watch寻找类似的东西,但是找不到合适的功能。
(A hack will do. Preferably in swift.) (可以做到。最好是迅速采取行动。)
You can add a timer with a known interval to re-set the data in labels or other controls. 您可以添加一个具有已知间隔的计时器,以重新设置标签或其他控件中的数据。 For example, add the following code in the timer code:
例如,在计时器代码中添加以下代码:
Swift 迅速
text1.setText([DATA])
Objective-C 目标C
[text1 setText:[DATA]];
NOTE: Waiting for the new versions is always the best way. 注意:等待新版本始终是最好的方法。 WWDC 2015 (June 8-12) will announce the new versions of WatchKit in San Francisco.
WWDC 2015(6月8日至12日)将在旧金山宣布WatchWatch的新版本。 They will introduce the ability of making native watch apps, and the missing APIs from WatchKit.
他们将介绍制作本地手表应用程序的功能以及WatchKit中缺少的API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.