Commit 2e93df3b authored by Zac Wood's avatar Zac Wood
Browse files

Added building search

parent 6b085653
......@@ -187,7 +187,9 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
func filterFacilitiesForSearchText(_ searchText: String) {
filteredFacilities = facilitiesArray.filter({(facility: Facility) -> Bool in
return facility.facilityName.lowercased().contains(searchText.lowercased())
let hasName = facility.facilityName.lowercased().contains(searchText.lowercased())
let hasBuilding = facility.facilityLocation?.building.lowercased().contains(searchText.lowercased()) ?? false
return hasName || hasBuilding
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment