从子类 UIPasteboard 选择中获取 NSRange
我想知道是否有某种方法可以子类化 UIPasteboard 以获得选择行为,但不能获得“剪切、复制和粘贴”选项。除此之外,是否有一些我可以订阅的通知,一旦选定文本正文就会返回其 NSRange?
感谢您的帮助!
编辑:我想使用这个子类来允许用户指示他们想要运行函数的区域。
I am wondering if there is some way to subclass UIPasteboard in order to get the selection behavior, but not get the "Cut, Copy, and Paste" options. In addition to this, is there some notification I can subscribe to that returns the NSRange of the selected body of text once it is selected?
Thanks for any help!
EDIT: I would like to use this subclass to allow the user to indicate the area that they would like to run a function on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有
UIPasteboard
支持两个通知:UIPasteboardChangedNotification
UIPasteboardRemovedNotification
我已经浏览了相关文档,但没有看到任何获取范围的方法的选择。
未来的操作系统版本可能会在这方面提供更多支持。
There are two notifications supported by
UIPasteboard
:UIPasteboardChangedNotification
UIPasteboardRemovedNotification
I've looked through the relevant docs and not seen any way to get a range of the selection.
It's possible that future OS versions might give a little more support in this area.