Nitin Nain
Nitin Nain

Reputation: 5483

How to update/refresh an Apple Watch Interface Controller?

I'm looking for a way to update/refresh the Interface Controller in watchkit.

Many iPhone apps employ a 'pull to refresh' or sometimes a way to reload the whole screen in a time bound manner. I'm looking for something similar for Apple Watch, but can't find an appropriate function.

(A hack will do. Preferably in swift.)

Upvotes: 1

Views: 2377

Answers (1)

Seyed Parsa Neshaei
Seyed Parsa Neshaei

Reputation: 3520

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

[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. They will introduce the ability of making native watch apps, and the missing APIs from WatchKit.

Upvotes: 2

Related Questions