Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get title from WKInterfaceButton

Tags:

swift

watchkit

To get title there is function:

setTitle

But how to get title of WKInterfaceButton as string ?

I did not found anything in https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceButton_class/index.html

like image 856
WebOrCode Avatar asked Nov 29 '14 18:11

WebOrCode


1 Answers

You can't get the state of any WKInterface UI element like buttons (WKInterfaceButton) label (WKInterfaceLabel) etc. I think this is designed by Apple like this because it involve under the hood communication between the extension running on your iOS device & the watch App. To save this overhead there are no getters and the extension should keep track of the state change (it is the one that can change the state).

like image 134
msk Avatar answered Oct 18 '22 20:10

msk