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

Filters UI is good to go

In theory, this is properly modifying filters such that when the filtering is fully implemented, this will update the filter
parent d3704019
......@@ -67,12 +67,28 @@
<outlet property="pickerView" destination="Rpt-Of-2BY" id="ek7-I8-MFW"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="toSelection" id="HkW-HK-Uqf">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="toSelection" textLabel="1gJ-n6-QQk" detailTextLabel="gbn-2b-WZh" style="IBUITableViewCellStyleValue1" id="HkW-HK-Uqf">
<rect key="frame" x="0.0" y="300.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="HkW-HK-Uqf" id="3BF-KX-2nF">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1gJ-n6-QQk">
<rect key="frame" x="16" y="12" width="33.5" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gbn-2b-WZh">
<rect key="frame" x="296" y="12" width="44" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="yIT-AR-gdn" kind="show" identifier="toSelection" id="86R-Fz-PuY"/>
......
......@@ -86,7 +86,7 @@ class FilterSelectionTableViewController: UITableViewController {
else {
let tableCell = tableView.cellForRow(at: indexPath)
var res: Bool
if(tableCell?.accessoryType == .none) {
if(tableCell?.accessoryType == UITableViewCellAccessoryType.none) {
res = true
}
else {
......@@ -97,14 +97,18 @@ class FilterSelectionTableViewController: UITableViewController {
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
if(segue.identifier == "toSelection") {
let destination = segue.destination as! FiltersTableViewController
destination.tableView.reloadData()
}
}
*/
}
......@@ -20,7 +20,17 @@ class FiltersTableViewController: UITableViewController {
}
@IBAction func resetButton(_ sender: Any) {
var c = filters.onlyFromCategories
var l = filters.onlyFromLocations
for v in c {
c.updateValue(true, forKey: v.key)
}
for v in l {
l.updateValue(true, forKey: v.key)
}
filters = Filters()
filters.onlyFromCategories = c
filters.onlyFromLocations = l
tableView.reloadData()
}
var filters: Filters!
......@@ -34,6 +44,7 @@ class FiltersTableViewController: UITableViewController {
override func viewWillAppear(_ animated: Bool) {
onlyOne = OnlyOneChecked(tableView: self, tableCellChecked: -1)
tableView.reloadData()
}
override func viewDidLoad() {
......@@ -50,8 +61,6 @@ class FiltersTableViewController: UITableViewController {
}
*/
tableView.reloadData()
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
......@@ -179,6 +188,7 @@ class FiltersTableViewController: UITableViewController {
else {
detail = "\(i) Selected"
}
cell.detailTextLabel?.text = detail
case 1:
cell.textLabel?.text = "Locations"
var i = 0
......@@ -194,6 +204,7 @@ class FiltersTableViewController: UITableViewController {
else {
detail = "\(i) Selected"
}
cell.detailTextLabel?.text = detail
default:
return cell
}
......@@ -300,13 +311,13 @@ class FiltersTableViewController: UITableViewController {
}
func selectAllFunc() -> Bool {
if((sender as! UITableViewCell).textLabel?.text! == "Categories") {
for var v in filters.onlyFromCategories {
v.value = true
for v in filters.onlyFromCategories {
filters.onlyFromCategories.updateValue(true, forKey: v.key)
}
}
else {
for var v in filters.onlyFromLocations {
v.value = true
for v in filters.onlyFromLocations {
filters.onlyFromLocations.updateValue(true, forKey: v.key)
}
}
return true
......
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