我的应用程序中有一些搜索选项,它会突出显示UISearchBar中的给定单词。给定的词可能在标签中出现多次,我不需要突出显示所有这些词。这怎么可能,我尝试了一些代码,但它只会突出显示该词的一次出现,这是我的示例代码:varSearchAttributeText="The"letrange=(TextValueasNSString).range(of:SearchAttributeText)letattribute=NSMutableAttributedString.init(string:TextValue)attribute.addAttribute(NSForegroundColo