From 08f25b2d191725c0f5ad2ad73a7e11b93333e6ca Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Fri, 21 Feb 2025 07:37:51 +0100 Subject: [PATCH 1/2] gallery searches in slug and title fixes #631 --- BeeSwift/Gallery/GalleryViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BeeSwift/Gallery/GalleryViewController.swift b/BeeSwift/Gallery/GalleryViewController.swift index 1af8ba8a..a549ef06 100644 --- a/BeeSwift/Gallery/GalleryViewController.swift +++ b/BeeSwift/Gallery/GalleryViewController.swift @@ -384,7 +384,11 @@ class GalleryViewController: UIViewController { func updateFilteredGoals() { if let searchText = searchBar.text, !searchText.isEmpty { - self.fetchedResultsController.fetchRequest.predicate = NSPredicate(format: "slug contains[cd] %@", searchText) + self.fetchedResultsController.fetchRequest.predicate = NSCompoundPredicate(orPredicateWithSubpredicates: + [ + NSPredicate(format: "slug contains[cd] %@", searchText), + NSPredicate(format: "title contains[cd] %@", searchText) + ]) } else { self.fetchedResultsController.fetchRequest.predicate = nil } From 53f0bec58a969d8d5f91b8912674642670ce9701 Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Fri, 21 Feb 2025 07:39:16 +0100 Subject: [PATCH 2/2] replace back-of-house term --- BeeSwift/Gallery/GalleryViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeeSwift/Gallery/GalleryViewController.swift b/BeeSwift/Gallery/GalleryViewController.swift index a549ef06..68d450ee 100644 --- a/BeeSwift/Gallery/GalleryViewController.swift +++ b/BeeSwift/Gallery/GalleryViewController.swift @@ -98,7 +98,7 @@ class GalleryViewController: UIViewController { let searchBar = UISearchBar() searchBar.accessibilityIdentifier = "searchBar" searchBar.delegate = self - searchBar.placeholder = "Filter goals by slug" + searchBar.placeholder = "Search goals" searchBar.isHidden = true searchBar.showsCancelButton = true return searchBar