Post

Replies

Boosts

Views

Activity

Reply to iOS Spotlight indexing seems to be broken on iOS 17?
I finally figured out a way to fix it. Previously when we create CSSearchableItemAttributeSet when only set its title property. Now with iOS 17, we also need to set displayName property in order for the item to show up. The code will look like this: let attribute = CSSearchableItemAttributeSet(contentType: .item) attribute.title = title attribute.displayName = title // this is the line that's not required before iOS 17, but necessary now let item = CSSearchableItem(uniqueIdentifier: id, domainIdentifier: nil, attributeSet: attribute) CSSearchableIndex.default().indexSearchableItems([item])
Sep ’23