better share icon and more haptics

parent a9d10e88
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "map@2x_2.png",
"scale" : "2x"
"scale" : "1x"
},
{
"idiom" : "universal",
......
......@@ -25,6 +25,7 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
let activity = NSUserActivity(activityType: "facility")
let feedback = UISelectionFeedbackGenerator()
/**
Favorites button touch handler
......@@ -32,13 +33,15 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
removes from favorites if it is a favorite.
*/
@IBAction func setFavButton(_ sender: Any) {
feedback.selectionChanged()
if(WOPUtilities.isFavoriteFacility(facility)) { // if the facility is a favorite
_ = WOPUtilities.removeFavoriteFacility(facility) // remove it from favorites
}
else { // else add it to favorites
_ = WOPUtilities.addFavoriteFacility(facility)
}
setFavoriteButtonText()
setFavoriteButtonText()
}
func getDirections(_ sender: Any) {
......@@ -72,7 +75,8 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
@IBAction func shareFacility(_ sender: Any) {
feedback.selectionChanged()
let str = "\(facility.facilityName) is \(WOPUtilities.openOrClosedUntil(facility)!.lowercased())"
// TODO in future: add URL based on facility once web supports it
let shareSheet = UIActivityViewController(activityItems: [str, (URL(string: "https://whatsopen.gmu.edu") ?? nil), facility], applicationActivities: [ViewInMapsActionActivity()])
......@@ -141,6 +145,7 @@ class DetailViewButtonsViewController: UIViewController, INUIAddVoiceShortcutVie
}
@IBAction func addToSiri(_ sender: Any) {
feedback.selectionChanged()
let intent = facility.createIntent()
let shortcuts = INVoiceShortcutCenter.shared
if let shortcut = INShortcut(intent: intent) {
......
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