Unverified Commit 0c04ee9d authored by Zach Knox's avatar Zach Knox
Browse files

fix peek and pop on alerts

parent a2f40249
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>1.0</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>6</string> <string>7</string>
<key>Fabric</key> <key>Fabric</key>
<dict> <dict>
<key>APIKey</key> <key>APIKey</key>
......
...@@ -814,12 +814,19 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate, ...@@ -814,12 +814,19 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
guard let indexPath = LocationsList?.indexPathForItem(at: location) else { return nil } guard let indexPath = LocationsList?.indexPathForItem(at: location) else { return nil }
let cell = LocationsList?.cellForItem(at: indexPath) as! FacilityCollectionViewCell if(indexPath.section == 1 || currentAlerts.count == 0) {
guard let detailView = storyboard?.instantiateViewController(withIdentifier: "detailView") as? FacilityDetailViewController else { return nil } let cell = LocationsList?.cellForItem(at: indexPath) as? FacilityCollectionViewCell
guard let detailView = storyboard?.instantiateViewController(withIdentifier: "detailView") as? FacilityDetailViewController else { return nil }
detailView.facility = cell.facility detailView.facility = cell?.facility
return detailView
}
else {
let cell = LocationsList?.cellForItem(at: indexPath) as? AlertCollectionViewCell
guard let detailView = storyboard?.instantiateViewController(withIdentifier: "alertDetail") as? AlertDetailViewController else { return nil }
detailView.alert = cell?.alert
return detailView
}
return detailView
} }
func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) { func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) {
......
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