Commit 71f33364 authored by Zach Knox's avatar Zach Knox
Browse files

If you guys want ths done in a month, we need to do this stuff too

**This isn't finished and may be broken in many places
parent ff4f6077
......@@ -13,6 +13,7 @@
92182EC01E95BD2C00192ABA /* LocationsListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92182EBF1E95BD2C00192ABA /* LocationsListViewController.swift */; };
92182EC41E95C38400192ABA /* LocationDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92182EC31E95C38400192ABA /* LocationDetailViewController.swift */; };
924840F81EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 924840F71EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift */; };
9265F3A11F2969E500A54A21 /* SettingTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9265F3A01F2969E500A54A21 /* SettingTableViewCell.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 */; };
......@@ -62,6 +63,7 @@
92182EBF1E95BD2C00192ABA /* LocationsListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationsListViewController.swift; sourceTree = "<group>"; };
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>"; };
9265F3A01F2969E500A54A21 /* SettingTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingTableViewCell.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>"; };
......@@ -144,6 +146,7 @@
927C80DB1EB18B89009079AD /* FiltersTableViewController.swift */,
9270A4DC1EC0010300DFBDA3 /* Filters.swift */,
9270A4DA1EB5565400DFBDA3 /* SwitchingTableViewCell.swift */,
9265F3A01F2969E500A54A21 /* SettingTableViewCell.swift */,
92108A321ED755F100675E16 /* CheckingTableViewCell.swift */,
CD466DD11DC12E1200E44DF5 /* MainTableViewController.swift */,
CD763A7D1DE253B900ADFD6B /* SRCTUtilities.swift */,
......@@ -349,6 +352,7 @@
CD763A7A1DE24EF100ADFD6B /* examplejson.swift in Sources */,
CD466DD21DC12E1200E44DF5 /* MainTableViewController.swift in Sources */,
924840F81EA915F200DBFF4E /* SRCTSimpleCollectionViewCell.swift in Sources */,
9265F3A11F2969E500A54A21 /* SettingTableViewCell.swift in Sources */,
9270A4DD1EC0010300DFBDA3 /* Filters.swift in Sources */,
927C80DC1EB18B89009079AD /* FiltersTableViewController.swift in Sources */,
CD763A7E1DE253B900ADFD6B /* SRCTUtilities.swift in Sources */,
......
......@@ -314,18 +314,22 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<imageView key="tableHeaderView" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="nFJ-xV-1rl">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Setting" textLabel="YYL-gW-pTv" style="IBUITableViewCellStyleDefault" id="uHy-SO-4Zr">
<rect key="frame" x="0.0" y="56" width="375" height="44"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Setting" textLabel="YYL-gW-pTv" style="IBUITableViewCellStyleDefault" id="uHy-SO-4Zr" customClass="SettingTableViewCell" customModule="WhatsOpen" customModuleProvider="target">
<rect key="frame" x="0.0" y="100" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="uHy-SO-4Zr" id="fwy-U7-SfD">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="YYL-gW-pTv">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="YYL-gW-pTv">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
......@@ -413,18 +417,18 @@
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bCL-Iy-li3" id="ObA-SL-u3j">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Wednesday" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="dvE-Be-8y6">
<rect key="frame" x="15" y="11" width="106" height="23"/>
<rect key="frame" x="15" y="11" width="106.5" height="23"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="12:00 AM - 11:59 PM" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fSJ-Gc-VIw">
<rect key="frame" x="201" y="13" width="159" height="21"/>
<rect key="frame" x="201" y="13" width="159" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
......
//
// SettingTableViewCell.swift
// WhatsOpen
//
// Created by Zach Knox on 7/26/17.
// Copyright © 2017 SRCT. All rights reserved.
//
import UIKit
import MessageUI
class SettingTableViewCell: UITableViewCell {
var linkURL: URL?
func initMail(subject: String, to: String) -> MFMailComposeViewController {
let mailto = MFMailComposeViewController()
mailto.setSubject(subject)
mailto.setToRecipients([to])
let df = DateFormatter()
let now = Date()
mailto.setMessageBody("\n\n"+df.string(from: now), isHTML: false)
return mailto
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
......@@ -7,6 +7,8 @@
//
import UIKit
import SafariServices
import MessageUI
class SettingsTableViewController: UITableViewController {
......@@ -33,23 +35,60 @@ class SettingsTableViewController: UITableViewController {
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 0
return 2
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 0
if(section == 0) {
return 1
}
else if(section == 1) {
return 2
}
else {
return 0
}
}
/*
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: "Setting", for: indexPath) as! SettingTableViewCell
switch indexPath.section {
case 0:
cell.textLabel!.text = "Are Our Hours Wrong?"
case 1:
if indexPath.row == 0 {
cell.textLabel!.text = "About SRCT"
cell.linkURL = URL(string: "https://srct.gmu.edu")
}
else if indexPath.row == 1 {
cell.textLabel!.text = "About What's Open"
}
default:
break
}
// Configure the cell...
return cell
}
*/
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = self.tableView(tableView, cellForRowAt: indexPath)
if let settingcell = cell as? SettingTableViewCell {
if settingcell.linkURL != nil {
self.showDetailViewController(SFSafariViewController(url: settingcell.linkURL!), sender: settingcell)
}
else if settingcell.textLabel?.text == "Are Our Hours Wrong?" {
let mailto = settingcell.initMail(subject: "What's Open - Your Hours are Wrong", to: "srct@gmu.edu")
print(mailto)
}
}
else {
return
}
}
/*
// Override to support conditional editing of the table view.
......
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