Commit f9aa33e4 authored by Zach Knox's avatar Zach Knox
Browse files

beginnings of getting segues working

Each Cell now contains a copy of the Facility it represents so it can pass it to the detail view
parent e5eb8f74
......@@ -17,6 +17,8 @@ class LocationDetailViewController: UIViewController, UITableViewDelegate, UITab
@IBOutlet var detailStackView: UIStackView!
var facility: Facility!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
......
......@@ -91,6 +91,7 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
let dataArray = placeOpenFacilitiesFirstInArray(facilitiesArray)
let facility = dataArray[indexPath.row]
cell.facility = facility
cell.nameLabel.text = facility.name
let open = Utilities.isOpen(facility: facility)
......@@ -155,15 +156,21 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before 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.
if(segue.identifier == "toDetailView") {
let destination = segue.destination as! LocationDetailViewController
let tapped = sender as! SRCTSimpleCollectionViewCell //this is probably a bad idea just FYI future me
destination.facility = tapped.facility
}
// Pass the selected object to the new view controller.
}
*/
}
......@@ -12,6 +12,7 @@ class SRCTSimpleCollectionViewCell: UICollectionViewCell {
@IBOutlet var nameLabel: UILabel!
@IBOutlet var timeDescriptionLabel: UILabel!
@IBOutlet var openClosedLabel: UILabel!
var facility: Facility!
override func awakeFromNib() {
super.awakeFromNib()
......
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