Saturday, October 14, 2023
HomeiOS Developmentios - Disable haptics on system controls

ios – Disable haptics on system controls


Is it attainable to disable haptic suggestions app-wide?

I do know loads of the app will not be “haptic-enabled” by default, however on a .contextMenu I can’t appear to show it off.

I’ve constructed a HapticManager the place I can management all my customized haptics or disable them in a settings toggle. Nonetheless, turning the toggle off solely controls my customized haptics and never the Apple ones.

remaining class HapticsManager {
  non-public let suggestions = UINotificationFeedbackGenerator()
  func set off(_ degree: UINotificationFeedbackGenerator.FeedbackType) {
    if UserDefaults.shared.bool(forKey: .settingsHapticsEnabled) {
      suggestions.notificationOccurred(degree)
    }
  }  
}

So I’m able to management the .set off() after I add it into actions like buttons or animations. However after I add in a Toggle() or a .contextMenu I’ve no management over these haptics.

I do not wish to make the person confused – and in addition not add within the performance – if I can have an effect on the haptics.

Significantly within the HIG:

Make haptics non-obligatory. Let folks flip off or mute haptics if they want, and ensure folks can nonetheless get pleasure from your app with out them.

Is that this attainable to do? In any other case is the one different technique to direct the person how one can disable System Haptics (https://www.techjunkie.com/turn-off-haptic-feedback-iphone/)

Every thing I’ve come throughout both has no solutions or solely talks about customized added haptics:



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments