How to delete a specific NSUserActivity search index?
问题 I use NSUserActivity to index a user activity for searching. I found a solution to delete a specific NSUserActivity , assign a CSSearchableItemAttributeSet with relatedUniqueIdentifier to NSUserActivity : let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeContact as String) attributeSet.relatedUniqueIdentifier = objectId let activity = NSUserActivity(activityType: Employee.domainIdentifier) activity.title = name activity.userInfo = userActivityUserInfo activity.keywords =