how to add haptic or sound to my custom keyboard

50 Views Asked by At

I want to add haptic and sound to my custom keyboard.

Here is my code.

let generator = UIImpactFeedbackGenerator(style: .medium)
generator.prepare()
generator.impactOccurred()

What's wrong?

0

There are 0 best solutions below