changeset 26:337816652bfe

Add haptics
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Tue, 20 Jul 2021 12:23:37 +0100
parents 933d9ab04374
children d95582268b44
files Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Simoleon/Functions/SimpleSuccess.swift Simoleon/Helpers/FavouriteButton.swift
diffstat 3 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Simoleon/Functions/SimpleSuccess.swift	Tue Jul 20 12:23:37 2021 +0100
@@ -0,0 +1,13 @@
+//
+//  SimpleSuccess.swift
+//  Simoleon
+//
+//  Created by Dennis Concepción Martín on 20/07/2021.
+//
+
+import SwiftUI
+
+func simpleSuccess() {
+    let generator = UINotificationFeedbackGenerator()
+    generator.notificationOccurred(.success)
+}
--- a/Simoleon/Helpers/FavouriteButton.swift	Tue Jul 20 12:23:32 2021 +0100
+++ b/Simoleon/Helpers/FavouriteButton.swift	Tue Jul 20 12:23:37 2021 +0100
@@ -16,8 +16,10 @@
         Button(action: {
             if isFavourite() {
                 removeFromFavourites()
+                simpleSuccess()
             } else {
                 addToFavourites()
+                simpleSuccess()
             }
         }) {
             RoundedRectangle(cornerRadius: 25)