Verified Commit 7620d2d4 authored by Eyad Hasan's avatar Eyad Hasan
Browse files

Adding code for an info-bubble pop when something is added to favorites

parent 90b5fc73
...@@ -16,6 +16,8 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie ...@@ -16,6 +16,8 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
@IBOutlet var facilityDetailView: UIView! @IBOutlet var facilityDetailView: UIView!
private var infoBubbleView: UIView!
var detailViewController: WOPFacilityDetailViewController? var detailViewController: WOPFacilityDetailViewController?
var facility: WOPFacility! var facility: WOPFacility!
...@@ -40,10 +42,25 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie ...@@ -40,10 +42,25 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
} }
else { // else add it to favorites else { // else add it to favorites
_ = WOPUtilities.addFavoriteFacility(facility) _ = WOPUtilities.addFavoriteFacility(facility)
loadInfoBubbleView()
} }
setFavoriteButtonText() setFavoriteButtonText()
} }
private func loadInfoBubbleView () {
let infoBubbleFrame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height - 200)
infoBubbleView = UIView(frame: infoBubbleFrame)
view.addSubview(infoBubbleView)
infoBubbleView.isHidden = false
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
self.infoBubbleView.isHidden = true
}
}
func getDirections(_ sender: Any) { func getDirections(_ sender: Any) {
let appToUse = WOPDatabaseController.getDefaults().value(forKey: "mapsApp") as? String let appToUse = WOPDatabaseController.getDefaults().value(forKey: "mapsApp") as? String
...@@ -107,6 +124,7 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie ...@@ -107,6 +124,7 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
self.addChild(self.detailViewController!) self.addChild(self.detailViewController!)
self.addSubview(self.detailViewController!.view, toView: self.facilityDetailView) self.addSubview(self.detailViewController!.view, toView: self.facilityDetailView)
super.viewDidLoad() super.viewDidLoad()
infoBubbleView.isHidden = true
setFavoriteButtonText() setFavoriteButtonText()
favoritesButton.tintColor = UIColor.white favoritesButton.tintColor = UIColor.white
......
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