Ios Coretext使NSMutableAttributedString的一部分可链接

Ios Coretext使NSMutableAttributedString的一部分可链接,ios,core-text,nsattributedstring,Ios,Core Text,Nsattributedstring,假设我有一个CoreTextNSMutableAttributedString,上面写着:“继续阅读” 我想让第一个单词“Continue”可以点击,这样我就可以点击它并显示加载另一个UIView。我已经找到了如何使它下划线和改变颜色为蓝色,但我如何才能使它链接。有什么例子吗 这是我的代码,使它下划线和前景颜色蓝色 CFAttributedStringSetAttribute(string, CFRangeMake(0, 10),kCTForegroundColorAttributeName,

假设我有一个CoreText
NSMutableAttributedString
,上面写着:“继续阅读”

我想让第一个单词“Continue”可以点击,这样我就可以点击它并显示加载另一个
UIView
。我已经找到了如何使它下划线和改变颜色为蓝色,但我如何才能使它链接。有什么例子吗

这是我的代码,使它下划线和前景颜色蓝色

CFAttributedStringSetAttribute(string, CFRangeMake(0, 10),kCTForegroundColorAttributeName, [UIColor blueColor].CGColor);
          SInt32 type = kCTUnderlineStyleSingle;

CFNumberRef underline = CFNumberCreate(NULL, kCFNumberSInt32Type, &type);
CFAttributedStringSetAttribute(string, CFRangeMake(0, text.length),kCTUnderlineStyleAttributeName, underline);
CFAttributedStringSetAttribute(string, CFRangeMake(0, text.length),kCTUnderlineColorAttributeName, [UIColor blueColor].CGColor);

谢谢

这里有很多资源,其中之一就是 在这里找到


您需要做的是找到要使其可单击的单词/部分的边界,并在这些边界内添加一个子视图来处理点击。希望有帮助

CoreText纯粹是一种渲染技术。它不处理交互。如果你需要可点击的词语,你需要自己去实现。可能有一个第三方图书馆已经在那里做了。嗨,凯文,谢谢你的兴趣…任何例子请。我相信你可以使用谷歌以及我可以。我搜索了一个多月,我刚刚发现,使网址检测链接任何帮助感谢。