Commit 2ce79f8d authored by Zach Knox's avatar Zach Knox
Browse files

Created model for filters. Please tell me if this is a bad idea how I did it

parent 58e96ef2
......@@ -13,6 +13,7 @@
92182EC41E95C38400192ABA /* LocationDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92182EC31E95C38400192ABA /* LocationDetailViewController.swift */; };
924840F81EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 924840F71EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift */; };
9270A4DB1EB5565400DFBDA3 /* SwitchingTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9270A4DA1EB5565400DFBDA3 /* SwitchingTableViewCell.swift */; };
9270A4DD1EC0010300DFBDA3 /* Filters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9270A4DC1EC0010300DFBDA3 /* Filters.swift */; };
927C80DA1EB02566009079AD /* SettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927C80D91EB02566009079AD /* SettingsTableViewController.swift */; };
927C80DC1EB18B89009079AD /* FiltersTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927C80DB1EB18B89009079AD /* FiltersTableViewController.swift */; };
CD3C97491DC18AB300A84434 /* SRCTNetworkController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3C97481DC18AB300A84434 /* SRCTNetworkController.swift */; };
......@@ -60,6 +61,7 @@
92182EC31E95C38400192ABA /* LocationDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationDetailViewController.swift; sourceTree = "<group>"; };
924840F71EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SRCTSimpleCollectionViewCell.swift; sourceTree = "<group>"; };
9270A4DA1EB5565400DFBDA3 /* SwitchingTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwitchingTableViewCell.swift; sourceTree = "<group>"; };
9270A4DC1EC0010300DFBDA3 /* Filters.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Filters.swift; sourceTree = "<group>"; };
927C80D91EB02566009079AD /* SettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = "<group>"; };
927C80DB1EB18B89009079AD /* FiltersTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FiltersTableViewController.swift; sourceTree = "<group>"; };
CD3C97481DC18AB300A84434 /* SRCTNetworkController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SRCTNetworkController.swift; sourceTree = "<group>"; };
......@@ -138,6 +140,7 @@
CD81F5301DC03AA700009FBD /* DataModel */,
CD81F51C1DC0334600009FBD /* AppDelegate.swift */,
927C80DB1EB18B89009079AD /* FiltersTableViewController.swift */,
9270A4DC1EC0010300DFBDA3 /* Filters.swift */,
9270A4DA1EB5565400DFBDA3 /* SwitchingTableViewCell.swift */,
CD466DD11DC12E1200E44DF5 /* MainTableViewController.swift */,
CD763A7D1DE253B900ADFD6B /* SRCTUtilities.swift */,
......@@ -342,6 +345,7 @@
CD763A7A1DE24EF100ADFD6B /* examplejson.swift in Sources */,
CD466DD21DC12E1200E44DF5 /* MainTableViewController.swift in Sources */,
924840F81EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift in Sources */,
9270A4DD1EC0010300DFBDA3 /* Filters.swift in Sources */,
927C80DC1EB18B89009079AD /* FiltersTableViewController.swift in Sources */,
CD763A7E1DE253B900ADFD6B /* SRCTUtilities.swift in Sources */,
927C80DA1EB02566009079AD /* SettingsTableViewController.swift in Sources */,
......
//
// Filters.swift
// WhatsOpen
//
// Created by Zach Knox on 5/7/17.
// Copyright © 2017 SRCT. All rights reserved.
//
import Foundation
//This may be a stupid way to handle filters, but it should work; at least for now
struct Filters {
var showOpen = true
var showClosed = true
var sortBy = SortMethod.alphabetical
var allAllFacilities = true
var facilitiesToShow: [Facility]
}
//Is this a viable way to do this?
enum SortMethod {
case alphabetical //A -> Z
case reverseAlphabetical //Z -> A
case openLongest //Places things open longest on top; if only showing closed, shows opening soonest
case openShortest //Places things closing soonest on top; if only showing closed, shows opening furthest from now
//We should figure out how we want to allow sorting
}
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