Commit 1395e35b authored by Jesse Scearce's avatar Jesse Scearce
Browse files

Added Abbreviations to search

parent ee1083c1
......@@ -61,6 +61,7 @@ class Locations: Object, Mappable {
@objc dynamic var address = ""
@objc dynamic var campus = ""
@objc dynamic var onCampus = false
@objc dynamic var abbreviation = ""
required convenience init?(map: Map){
self.init()
......@@ -74,6 +75,7 @@ class Locations: Object, Mappable {
address <- map["address"]
campus <- map["campus_region"]
onCampus <- map["on_campus"]
abbreviation <- map["friendly_building"]
}
func equals(_ another: Locations) -> Bool {
......
......@@ -41,6 +41,7 @@ class AboutScreenViewController: UIViewController, UITableViewDelegate, UITableV
"Eyad Hasan",
"Zach Knox",
"Patrick Murray",
"Jesse Scearce",
"Zac Wood",
"Jason Yeomans"
]
......
......@@ -345,6 +345,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
filtered = filteredFacilities.filter({(facility: Facility) -> Bool in
let hasName = facility.facilityName.lowercased().contains(searchText.lowercased())
let hasBuilding = facility.facilityLocation?.building.lowercased().contains(searchText.lowercased()) ?? false
let hasAbbreviation = facility.facilityLocation?.abbreviation.lowercased().contains(searchText.lowercased()) ?? false
let hasCategory = facility.category?.categoryName.lowercased().contains(searchText.lowercased()) ?? false
var hasTag = false
for tag in facility.facilityTags! {
......@@ -364,7 +365,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
hasLabel = true
}
}
return hasName || hasBuilding || hasCategory || hasTag
return hasName || hasBuilding || hasCategory || hasTag || hasAbbreviation
})
LocationsList.reloadData()
......
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