When a user touches the screen/button what are the feedback options to show it is touched?
- Change the look of the area
- Play a sound
are these the only 2 ways or can you make the phone vibrate?
When a user touches the screen/button what are the feedback options to show it is touched?
Sorry didn’t show up on first search
Public Sub Vibrate()
Const kSystemSoundID_Vibrate = 4095
Declare Sub AudioServicesPlaySystemSound Lib “AudioToolbox.framework” (snd As Integer)
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
End Sub
Hmm, not actually getting any feedback from the iPad using this??
Of course not available on iPad
[quote=494226:@Martin Fitzgibbons]Sorry didn’t show up on first search
Public Sub Vibrate()
Const kSystemSoundID_Vibrate = 4095
Declare Sub AudioServicesPlaySystemSound Lib “AudioToolbox.framework” (snd As Integer)
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
End Sub[/quote]
That is not the way to do it.
I’ll post some code later today
You will need to use iOSKit: https://github.com/kingj5/iOSKit
Then have an instance of one of the following:
-UIKit.UIImpactFeedbackGenerator
-UIKit.UISelectionFeedbackGenerator
-UIKit.UINotificationFeedbackGenerator
All of these classes have a Prepare
and a Trigger
method.
The Prepare (optional) tells the haptic engine to prepare for a trigger and only needs to be called once (per trigger style) in the lifecycle of the app. If Prepare is never called, the first call to Trigger will have a few 100 milliseconds delay.