Hello.
I'm adding my mac app contents to spotlight index. I have created a dedicated exported document type which Finder also recognises and shows documents with my extension "artcl" with correct icon I provide with the app. But it does not happen in Spotlight - it shows my documents with default icon.
I create items for Spotligh index as follows:
let myType = UTType(filenameExtension: "artcl")!
var searchableItems: [CSSearchableItem] = []
for itm in items.reversed() {
let attributeSet = CSSearchableItemAttributeSet(contentType: myType)
attributeSet.title = item.title
attributeSet.contentDescription = item.desc
attributeSet.displayName = item.name
attributeSet.keywords = [ item.title ]
attributeSet.comment = item.title + " " + item.desc
attributeSet.contentType = "com.devaikin.spottest.artcl"
let id = "artcl." + item.title + "." + item.name
let indexItem = CSSearchableItem(uniqueIdentifier: id, domainIdentifier: "artcl", attributeSet: attributeSet)
searchableItems.append(indexItem)
let defaultIndex = CSSearchableIndex(name: "Spottest")
defaultIndex.deleteAllSearchableItems()
defaultIndex.beginBatch()
defaultIndex.indexSearchableItems(searchableItems)
...
Items are added to the spotlight and I can find them, but default icon is displayed while I would expect my exported type icon to be shown like Finder does it.
Am I missing something in attributeSet setup?