How to get title from WKInterfaceButton

前端 未结 1 1360
甜味超标
甜味超标 2021-01-11 12:58

To get title there is function:

setTitle

But how to get title of WKInterfaceButton as string ?

I did not found anything in https:

1条回答
  •  暖寄归人
    2021-01-11 13:28

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

    0 讨论(0)
提交回复
热议问题