gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 15/69: hapticFeedback


From: gnunet
Subject: [taler-taler-ios] 15/69: hapticFeedback
Date: Fri, 19 Jan 2024 09:01:48 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit 52494d6349340e56b0e259d91be37c815c32f6b5
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Jan 3 17:39:54 2024 +0100

    hapticFeedback
---
 TalerWallet1/Helper/Controller+playSound.swift | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/TalerWallet1/Helper/Controller+playSound.swift 
b/TalerWallet1/Helper/Controller+playSound.swift
index 8f83435..c86858b 100644
--- a/TalerWallet1/Helper/Controller+playSound.swift
+++ b/TalerWallet1/Helper/Controller+playSound.swift
@@ -11,15 +11,28 @@ extension Controller {
     @MainActor
     func hapticNotification(_ feedbackType: 
UINotificationFeedbackGenerator.FeedbackType) {
         if useHaptics {
+            /// call when a notification is displayed, passing the 
corresponding type
             
UINotificationFeedbackGenerator().notificationOccurred(feedbackType)
         }
     }
 
     @MainActor
     func hapticFeedback(_ feedbackStyle: 
UIImpactFeedbackGenerator.FeedbackStyle) {
+        /// call when your UI element impacts something else
         UIImpactFeedbackGenerator(style: feedbackStyle).impactOccurred()
     }
 
+    @MainActor
+    func hapticFeedback(intensity: CGFloat) {
+        /// call when your UI element impacts something else with a specific 
intensity [0.0, 1.0]
+        UIImpactFeedbackGenerator().impactOccurred(intensity: intensity)
+    }
+
+    @MainActor
+    func hapticFeedback() {
+        /// call when the selection changes (not on initial selection)
+        UISelectionFeedbackGenerator().selectionChanged()
+    }
 
     /// 0 = failure, 1 = received, 2 = sent
     @MainActor func playSound(_ number: Int) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]