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

fixed up filters not displaying immediately and sort by not switching right

parent aeaf1bbc
......@@ -23,6 +23,7 @@ class CheckingTableViewCell: UITableViewCell {
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
if(selected) {
selectFunc(selectingEnum)
onlyOne.setCheckToCellWithID(cellIndex)
super.setSelected(false, animated: animated)
}
......
......@@ -132,7 +132,13 @@ class Filters {
private func sortAlphabetically(_ facilities: List<Facility>, reverse: Bool = false) -> List<Facility> {
// Convert to a swift array because the realm sorting method crashes the list object for some reason?
var facilitiesArray = facilities.asArray()
facilitiesArray.sort { $0.facilityName < $1.facilityName }
if !reverse {
facilitiesArray.sort { $0.facilityName < $1.facilityName }
}
else {
facilitiesArray.sort { $0.facilityName > $1.facilityName }
}
return facilitiesArray.asRealmList()
}
......
......@@ -139,6 +139,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
override func viewWillAppear(_ animated: Bool) {
LastUpdatedLabel.isEnabled = false
checkFilterState()
reloadWithFilters()
}
@objc func tapRecognizer(_ sender: UITapGestureRecognizer) {
......
......@@ -137,7 +137,7 @@ class FiltersTableViewController: UITableViewController {
cell.switchControl.isOn = filters.openFirst
cell.toggleFunc = filters.setOpenFirst
return cell
case 2: // TODO
case 2:
let method: SortMethod
let cellText: String
switch indexPath.row {
......@@ -169,7 +169,7 @@ class FiltersTableViewController: UITableViewController {
cell.textLabel!.text = cellText
sortOptions.append(cell)
return cell
case 3: // TODO
case 3:
let cell = tableView.dequeueReusableCell(withIdentifier: "toSelection", for: indexPath)
cell.accessoryType = .disclosureIndicator
switch indexPath.row {
......
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