I have spent plenty of time to find benefit of NSUserActivity over CoreSpotlight, whether i couldn't find anything practically.
Actually, it couldn't index our item, which we set through NSUserActivity. I have attached my snippet below, which supposed to work as per apple documentation,however it won't.
let personName = "Jon Doe"
let activity = NSUserActivity(activityType: "com.SearchAPIs.test”)
activity.userInfo = ["name": "Jon Doe"]
activity.title = person.name
let keywords = personName.componentsSeparatedByString(" ")
activity.keywords = Set(keywords)
activity.eligibleForSearch = true
activity.eligibleForPublicIndexing = true
activity.expirationDate = NSDate().dateByAddingTimeInterval(16666600)
activity.becomeCurrent()
I would like to find answer of
Why we need to use NSUserActivity in way of search, since it can be possible with CoreSpotlight?