diff Simoleon/UI/FavoriteButton.swift @ 162:f5de15e06c77

Refactor code
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Tue, 31 Aug 2021 13:04:28 +0100
parents 3913aff613e8
children
line wrap: on
line diff
--- a/Simoleon/UI/FavoriteButton.swift	Tue Aug 31 10:57:34 2021 +0100
+++ b/Simoleon/UI/FavoriteButton.swift	Tue Aug 31 13:04:28 2021 +0100
@@ -13,6 +13,8 @@
     @Environment(\.managedObjectContext) private var viewContext
     @FetchRequest(sortDescriptors: []) private var favoritePairs: FetchedResults<FavoritePair>
     
+    let hapticsHelper = HapticsHelper()
+    
     var body: some View {
         Button(action: {
             animate()
@@ -21,6 +23,8 @@
             } else {
                 add()
             }
+            
+            hapticsHelper.simpleSuccess()
         }) {
             RoundedRectangle(cornerRadius: 15)
                 .foregroundColor(Color(.secondarySystemBackground))