How to get title from WKInterfaceButton

情到浓时终转凉″ 提交于 2019-12-04 00:39:59

问题


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


回答1:


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).



来源:https://stackoverflow.com/questions/27205623/how-to-get-title-from-wkinterfacebutton

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!