3

I recently came across Google Calendar iOS app, and it provides a crisp-yet-very-light haptic feedback when dragging or creating events. I'm trying to implement the same.

I figured out that the UIImpactFeedbackGenerator's .light impact is still too strong for my requirement.

After a bit of digging, I came across CHHapticEngine from the 'Core Haptics' library which supports custom haptics when provided with 'sharpness' and 'intensity' parameters. But it seems like this CHHapticEngine does not work on an iPhone 7 Plus and Google has somehow pulled this off.

CHHapticEngine does not work?

1) CHHapticEngine.capabilitiesForHardware().supportsHaptics returns false

2) When I try to use it without the check, it returns:

(com.apple.CoreHaptics error -4809.)

So, is there another way to generate custom haptics(with varying sharpness and intensity levels) that works universally on all iOS devices that have Taptic Engine? TYIA!

Lokesh SN
  • 1,583
  • 7
  • 23
  • did you find anything? i have a problem that IPhones 7 should support CHHapticEngine (it has taptic engine in it), but it doesn't for some reason – nt4f04und Feb 05 '21 at 15:38
  • I ended up achieving almost the same output with `UIImpactFeedbackGenerator(style: .rigid)` with an intensity of `0.7` (If a similar haptic output is what you're after, compared to the means of achieving it, you can explore this route) – Lokesh SN Feb 06 '21 at 14:51
  • @ nt4f04und Did you find a solution? – eral Dec 17 '21 at 16:09

0 Answers0