Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an example code for corespotlight search feature - iOS 9 API?

Tags:

Is there an example code for corespotlight search feature - iOS 9 API? Really appreciate if can look at sample code to implement/test.

like image 509
mojo_ Avatar asked Jun 26 '15 00:06

mojo_


1 Answers

  1. Create a new iOS project and add CoreSpotlight and MobileCoreServices framework to your project. enter image description here

  2. Create the actual CSSearchableItem and associating the uniqueIdentifier, domainIdentifier and the attributeSet. Finally index the CSSearchableItem using [[CSSearchableIndex defaultSearchableIndex]...] as show below. enter image description here

  3. OK!Test the index!
    enter image description here

like image 119
mayqiyue Avatar answered Sep 29 '22 11:09

mayqiyue