CoreSpotlight thumbnails not shown on devices running iOS 14.0 (Regression from iOS 13.6)

Originator:steviebm
Number:rdar://FB8811908 Date Originated:2020/10/09
Status:Open Resolved:
Product:Spotlight Search Product Version:
Classification:Incorrect/Unexpected Behavior Reproducible:Yes
 
CSSearchableItemAttributeSet.thumbnailData content is not shown on devices running iOS 14.0.1, but is shown in Simulators running iOS 14.0 and on devices running iOS 13.

Steps to reproduce:
1. Create new Xcode project using the iOS App template (Interface: SwiftUI, Life Cycle: UIKit App Delegate, Language: Swift, disable Core Data and Tests)
2. Change deployment target to iOS 13.6 (also fails on iOS 14 without this step, but this is useful to show regression)
3. In ContentView.swift, update ContentView to the following:

```
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 (tested on iPhone 11 Pro and iPad mini 5th gen) 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.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!