Easily generate vibrations, built in Taptic Engine & Haptic Feedback at your iOS apps.
TapticEffects generates feedback vibrations using Taptic or Haptic Engine on iOS device. I don't post any example project, becasue there is no need for this. Class is simple and easy in use. It is just wrapper of UINotificationFeedbackGenerator, UISelectionFeedbackGenerator, UIImpactFeedbackGenerator.
TapticEffects class doesn't require any initialization at your project. You can call its methods from any place using type methods of class.
/// Performs haptic feedback - impact.
TapticEffectsService.performFeedbackImpact(style: .medium)
/// Performs haptic feedback - selection.
TapticEffectsService.performFeedbackSelection()
/// Performs taptic feedback based on 'TapticEngineFeedbackIdentifier'.
TapticEffectsService.performTapticFeedback(from: TapticEffectsService.TapticEngineFeedbackIdentifier.peek)
/// Available Identifiers
/// 'Peek' feedback (weak boom)
case peek = 1519
/// 'Pop' feedback (strong boom)
case pop = 1520
/// 'Cancelled' feedback (three sequential weak booms)
case cancelled = 1521
/// 'Try Again' feedback (week boom then strong boom)
case tryAgain = 1102
/// 'Failed' feedback (three sequential strong booms)
case failed = 1107
- Swift 3.0+
- iOS 10.0+
- iPhone 6s or higher
Just download and drop TapticEffectsService.swift
class into your project.
TapticEffects is available under the MIT license. See the LICENSE file for more info.