Now I have an extension to make the device vibrate from anywhere in the app:
extension UIDevice {
static func vibrate(style: UINotificationFeedbackGenerator.FeedbackType) {
guard CHHapticEngine.capabilitiesForHardware().supportsHaptics else {
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
return
}
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(style)
}
}
The problem is with the devices, that uses haptics. Now I am using style as warning
but the device vibration is very weak, not even noticeable. Is there another way to make the device vibrate 2 times, or more intense?
I have tried different vibration styles in code, but vibration is still very weak.