Commit 04a4b74d authored by Zach Knox's avatar Zach Knox
Browse files

Check out those pretty new collection view cells

parent 3c57a2c8
......@@ -7,6 +7,7 @@
//
import UIKit
import SafariServices
class AboutScreenViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
......@@ -40,23 +41,55 @@ class AboutScreenViewController: UIViewController, UITableViewDelegate, UITableV
]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0:
return 1
case 1:
return contributors.count
default:
return 0
}
return contributors.count
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "Thanks to the contributors to What's Open!"
switch section {
case 0:
return "What's Open for iOS is an open source project created by students at George Mason University"
case 1:
return "Thanks to the contributors to What's Open!"
default:
return ""
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Contributor", for: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: "Contributor", for: indexPath) as! SettingTableViewCell
cell.textLabel!.text = contributors[indexPath.row]
switch indexPath.section {
case 0:
cell.textLabel!.text = "Check out our code on Gitlab"
cell.selectionStyle = UITableViewCellSelectionStyle.blue
cell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator
case 1:
cell.textLabel!.text = contributors[indexPath.row]
default:
break
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
let cell = self.tableView(tableView, cellForRowAt: indexPath) as! SettingTableViewCell
let lnk = URL(string: "https://git.gmu.edu/srct/whats-open-ios")
self.showDetailViewController(SFSafariViewController(url: lnk!), sender: cell)
}
}
func numberOfSections(in tableView: UITableView) -> Int {
return 1
return 2
}
......
......@@ -155,9 +155,12 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
if(open == true) {
cell.openClosedLabel.text = "Open"
cell.openClosedLabel.backgroundColor = UIColor(red:0.00, green:0.40, blue:0.20, alpha:1.0)
cell.backgroundColor = UIColor(red:0.00, green:0.40, blue:0.20, alpha:1.0)
} else {
cell.openClosedLabel.text = "Closed"
cell.openClosedLabel.backgroundColor = UIColor.red
cell.backgroundColor = UIColor.red
}
cell.timeDescriptionLabel.text = Utilities.timeUntilFacility(facility)
......
......@@ -91,7 +91,8 @@ class SettingsTableViewController: UITableViewController {
self.showDetailViewController(SFSafariViewController(url: settingcell.linkURL!), sender: settingcell)
}
else if settingcell.textLabel?.text == "Are Our Hours Wrong?" {
settingcell.initMail(subject: "What's Open - Your Hours are Wrong", to: "srct@gmu.edu")
let mailvc = settingcell.initMail(subject: "What's Open - Your Hours are Wrong", to: "srct@gmu.edu")
self.showDetailViewController(mailvc, sender: cell)
}
else if settingcell.textLabel!.text == "About What's Open" {
let avc = self.storyboard?.instantiateViewController(withIdentifier: "about")
......
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