I am *so* pleased to see I'm not the only one with this problem: I thought I was losing my mind!
@Quinn: I've filed rdar://FB8811908 (
CoreSpotlight thumbnails not shown on devices running iOS 14.0 (Regression from iOS 13.6)). As I say there, this is minimally reproducible (for me, at least). I've also added
the main files from a minimal test app to a gist.
The steps I took to consistently reproduce (also in the feedback):
Steps to reproduce:
Create new Xcode project using the iOS App template (Interface: SwiftUI, Life Cycle: UIKit App Delegate, Language: Swift, disable Core Data and Tests)
Change deployment target to iOS 13.6
In ContentView.swift, update ContentView to the following:
Code Block struct ContentView: View { |
var body: some View { |
Text("Hello, UIKit!") |
.onAppear(perform: { |
let attributeSet = CSSearchableItemAttributeSet( |
itemContentType: "public.content" |
) |
attributeSet.displayName = "Hello UIKit?" |
attributeSet.thumbnailData = UIImage( |
systemName: "hand.thumbsup.fill" |
)?.pngData() |
let item = CSSearchableItem( |
uniqueIdentifier: "uikit.shelloworld", |
domainIdentifier: nil, |
attributeSet: attributeSet) |
CSSearchableIndex.default() |
.indexSearchableItems([item]) { (error) in |
print(error as Any) |
} |
}) |
} |
} |
4. Deploy to a physical device running iOS 14.0.1 and search for
Hello UIKit, and observe the missing image. Contrast to results for the same search in simulator running iOS 14.0, or on devices running iOS 13.6.