Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show goals in Spotlight #472

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Show goals in Spotlight #472

merged 1 commit into from
Aug 12, 2024

Conversation

theospears
Copy link
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
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
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
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"

@@ -171,7 +174,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
}
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
Contributor

Choose a reason for hiding this comment

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

👍

@theospears theospears merged commit b254380 into master Aug 12, 2024
3 checks passed
@theospears theospears deleted the index-to-spotlight branch August 12, 2024 04:12
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