快速检索WKInterfaceLabel的文本 [英] retrieve the text of WKInterfaceLabel in swift

查看:74
本文介绍了快速检索WKInterfaceLabel的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在WatchKit中使用Swift或Objective-C获取标签文本?
该类不是UILabel,而是WKInterfaceLabel.
我还尝试在

How can i get the text of label in Swift or Objective-C in WatchKit?
The class is not UILabel but it is WKInterfaceLabel.
I have also tried to search in class library of apple but there is only three methods are available.

推荐答案

通过阅读

By reading reference it is not possible you have to maintain track which you set in label
looks like apple is very strict about this class you can not create a subclass or direct instance of this.

They only talk about how to set the text not about getting text

没有一个超级类具有获取文本的方法

如果可能,您可以创建WKInterfaceLabel的扩展并获取文本
但不知道苹果是否批准.

Non of it's supper class have method to get text

If its posible You can create extension of WKInterfaceLabel and get text
but no idea if apple approve it or not.

我的结论是
无法通过任何方式直接获取文本
您可以做一些技巧,但要确保它被苹果接受.


友好地讲,我对watch SDK的了解不多,但是如果您处理的是beta版本的东西,请希望苹果能像他们写的那样在新版本中添加该东西

My Conclusion is
Its not possible directly by any way to get text
you can do some trick but make sure that its acceptable by apple.


Friendly speaking i am not much aware about watch SDK, but if you dealing with any beta version of type thing let hope that apple will add that thing in new version as they had wrote


我写的所有参考文献和图像均


Reference of all i wrote and images are here

这篇关于快速检索WKInterfaceLabel的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆