From 34a119457787cbb0b8f9e147560c3dcf9f913200 Mon Sep 17 00:00:00 2001 From: MhdHejazi Date: Sun, 15 Mar 2020 01:23:29 +0300 Subject: [PATCH] Case insensitive search. --- Corona/Controller/RegionContainerController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Corona/Controller/RegionContainerController.swift b/Corona/Controller/RegionContainerController.swift index 5e73e24..dfe5b3b 100644 --- a/Corona/Controller/RegionContainerController.swift +++ b/Corona/Controller/RegionContainerController.swift @@ -111,10 +111,10 @@ extension RegionContainerController: UISearchBarDelegate, UITableViewDelegate { func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { var reports = DataManager.instance.allReports - let query = searchText.trimmingCharacters(in: .whitespacesAndNewlines) + let query = searchText.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() if !query.isEmpty { reports = reports.filter({ report in - report.region.name.contains(query) + report.region.name.lowercased().contains(query) }) }