ios - CoreSpotlight indexing not working -


i using corespotlight api index content. reason not able find data when search in spotlight.

let atset:cssearchableitemattributeset = cssearchableitemattributeset()   atset.title = "simple title"   atset.contentdescription = "simple twitter search"   let item = cssearchableitem(uniqueidentifier: "id1", domainidentifier: "com.shrikar.twitter.search", attributeset: atset)   cssearchableindex.defaultsearchableindex().indexsearchableitems([item]) { (error) -> void in    print("indexed")   }   

when run app see data indexed , error nil. have added corespotlight , mobilecoreservices build phase.

try use itemcontenttype initializer :

let atset:cssearchableitemattributeset = cssearchableitemattributeset(itemcontenttype: kuttypeimage string) atset.title = "simple title" atset.contentdescription = "simple twitter search" let item = cssearchableitem(uniqueidentifier: "id1", domainidentifier: "com.shrikar.twitter.search", attributeset: atset) cssearchableindex.defaultsearchableindex().indexsearchableitems([item]) { (error) -> void in     print("indexed")   } 

the kuttypeimage declared in mobilecoreservices.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -