NEW: Start my new Ultimate Portfolio App course with a free Hacking with Swift+ trial! >>

Core Spotlight - modify results UI

Forums > SwiftUI

Gone through the excellent tutorial in the Ultimate Portfolio course on how to implement spotlight in your app. I was just wondering whether there is a way to modify how results from Spotlight for your app are shown. E.g. add more details than only title or contentDescription. I saw attributes like containerTitle, etc..

Or is this not possible to change from within your app and with SwiftUI?

Thanks!

   

The Ultimate Portfolio app only uses simple things such title and description, however if your own app uses maps, music, images, etc,, I can't see why you could not provide other information in the Spotlight search, as long as your app can provide the data.

The details are in the documentation for CSSearchableItemAttributeSet (accessed via XCode quick help for CSSearchableIndex), or at least it is a starting point.

If you are talking about how things look in Spotlight, then I think probably not, at least I have not seen anything. Also Spotlight is a feature on the device that is part of the OS (iOS, macOS, etc.) so Apple have determined how things look in Spotlight.

1      

Hacking with Swift is sponsored by Instabug

SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred. Instabug's SDK grabs all the logs they need to fix bugs, crashes and performance issues in minutes instead of days. Get screenshots, device details, network logs, repro steps, and tons of other critical insights needed to resolve issues and prioritize product backlogs straight from your dashboard. It only takes a minute to integrate!

Get started now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.