Unverified Commit c3ce5dba authored by Zach Knox's avatar Zach Knox
Browse files

fixed filter bugs and reset filters button

parent c14347e3
......@@ -233,6 +233,7 @@
isa = PBXNativeTarget;
buildConfigurationList = CD81F52B1DC0334600009FBD /* Build configuration list for PBXNativeTarget "WhatsOpen" */;
buildPhases = (
92A4237E201190EA00010B73 /* ShellScript */,
50D6F624F16EB519DDA7AD66 /* [CP] Check Pods Manifest.lock */,
CD81F5151DC0334600009FBD /* Sources */,
CD81F5161DC0334600009FBD /* Frameworks */,
......@@ -241,7 +242,6 @@
E09CBA67A9A59A8E148F3FE7 /* [CP] Copy Pods Resources */,
92FF6C7820017E1C00D836AE /* Run Script */,
922C3C1B200306F5008E1146 /* ShellScript */,
92A4237E201190EA00010B73 /* ShellScript */,
);
buildRules = (
);
......@@ -271,7 +271,7 @@
};
CD81F5181DC0334600009FBD = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = N5GM564QWL;
DevelopmentTeam = K5MMVK2UFR;
LastSwiftMigration = 0910;
ProvisioningStyle = Automatic;
};
......
......@@ -33,7 +33,7 @@ class Filters {
let specifiedFacilities = List<Facility>()
// facility must be within both a specified location and category
for f in facilities {
if(onlyFromLocations[(f.facilityLocation?.building)!] == true && onlyFromCategories[(f.category?.categoryName)!] == true && onlyFromCampuses[(f.facilityLocation?.campus)!] == true) {
if(onlyFromLocations[(f.facilityLocation?.building)!.lowercased()] == true && onlyFromCategories[(f.category?.categoryName)!.lowercased()] == true && onlyFromCampuses[(f.facilityLocation?.campus)!.lowercased()] == true) {
specifiedFacilities.append(f)
}
}
......
......@@ -23,7 +23,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>7</string>
<string>9</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
......
......@@ -414,13 +414,13 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
// Add locations and categories to filters
for f in facilitiesArray {
if(!filters.onlyFromCategories.keys.contains((f.category?.categoryName)!)) {
filters.onlyFromCategories.updateValue(true, forKey: (f.category?.categoryName)!)
filters.onlyFromCategories.updateValue(true, forKey: (f.category?.categoryName)!.lowercased())
}
if(!filters.onlyFromLocations.keys.contains((f.facilityLocation?.building)!)) {
filters.onlyFromLocations.updateValue(true, forKey: (f.facilityLocation?.building)!)
filters.onlyFromLocations.updateValue(true, forKey: (f.facilityLocation?.building)!.lowercased())
}
if(!filters.onlyFromCampuses.keys.contains((f.facilityLocation?.campus)!)) {
filters.onlyFromCampuses.updateValue(true, forKey: (f.facilityLocation?.campus)!)
filters.onlyFromCampuses.updateValue(true, forKey: (f.facilityLocation?.campus)!.lowercased())
}
}
}
......
......@@ -28,7 +28,10 @@ class FiltersTableViewController: UITableViewController {
for v in l {
l.updateValue(true, forKey: v.key)
}
filters = Filters()
filters.openFirst = true
filters.showClosed = true
filters.showOpen = true
filters.sortBy = .alphabetical
filters.onlyFromCategories = c
filters.onlyFromLocations = l
tableView.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