2

Is it possible to disable haptic feedback app-wide?

I know a lot of the app is not "haptic-enabled" by default, but on a .contextMenu I cannot seem to turn it off.

I've built a HapticManager where I can control all my custom haptics or disable them in a settings toggle. However, turning the toggle off only controls my custom haptics and not the Apple ones.

final class HapticsManager {
  private let feedback = UINotificationFeedbackGenerator()
  func trigger(_ level: UINotificationFeedbackGenerator.FeedbackType) {
    if UserDefaults.shared.bool(forKey: .settingsHapticsEnabled) {
      feedback.notificationOccurred(level)
    }
  }  
}

So I am able to control the .trigger() when I add it into actions like buttons or animations. But when I add in a Toggle() or a .contextMenu I have no control over those haptics.

I don't want to make the user confused - and also not add in the functionality - if I can affect the haptics.

Particularly in the HIG:

Make haptics optional. Let people turn off or mute haptics if they wish, and make sure people can still enjoy your app without them.

Is this possible to do? Otherwise is the only other way to direct the user how to disable System Haptics (https://www.techjunkie.com/turn-off-haptic-feedback-iphone/)

Everything I've come across either has no answers or only talks about custom added haptics:

markb
  • 1,100
  • 1
  • 15
  • 40

0 Answers0