Skip to content

Commit

Permalink
Case insensitive search.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdhejazi committed Mar 14, 2020
1 parent 3c25aec commit 34a1194
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Corona/Controller/RegionContainerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down

0 comments on commit 34a1194

Please sign in to comment.