Skip to content

Show goals in Spotlight#472

Merged
theospears merged 1 commit intomasterfrom
index-to-spotlight
Aug 12, 2024
Merged

Show goals in Spotlight#472
theospears merged 1 commit intomasterfrom
index-to-spotlight

Conversation

@theospears
Copy link
Copy Markdown
Collaborator

@theospears theospears commented Aug 10, 2024

Uses the integration between CoreData and Spotlight to make goal information available in spotlight search.

Testing:
Ran on device and saw the entries appear in spotlight
Verified clicking on items navigates to the app

@theospears theospears changed the title Indexing goals to spotlight Show goals in Spotlight Aug 10, 2024
Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @theospears and the rest of your teammates on Graphite Graphite

@theospears theospears marked this pull request as ready for review August 10, 2024 04:04
class BeeminderSpotlightDelegate: NSCoreDataCoreSpotlightDelegate {

override func attributeSet(for object: NSManagedObject) -> CSSearchableItemAttributeSet? {
if let goal = object as? Goal {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer swift's guard here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The examples in the docs choose this approach because it scales nicely to multiple different types. It's unclear what other types beeswift might want to index though, so I'm leaning towards "either would be fine"

}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if let intent = userActivity.interaction?.intent as? AddDataIntent {
if userActivity.activityType == CSSearchableItemActionType {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants