大家都知道,UITextVview可以用以下方法自动检测text中的链接:
let label = UITextView()
label.dataDetectorTypes = .link
label.isEditable = false
如果我们使用的attributedString后,会发现如果添加Attachment后,会触发一个选择(编辑的GR),如果我们只想要链接的gr,不想要选择的gr,可以遍历并禁用它。方法如下:
传送门:http://stackoverflow.co[......]