Haptica is an easy haptic feedback generator.
$ pod try Haptica
- iOS 10.0+
- Xcode 8.0+
- Swift 3.0+
- A device with a supported Taptic Engine (iPhone 7 and iPhone 7 Plus).
- App is running in the foreground.
- System Haptics setting is enabled.
Generate using a haptic feedback type.
Haptic.impact(.light).generate()
- Impact: (UIImpactFeedbackStyle)
- light
- medium
- heavy
- Notification: (UINotificationFeedbackType)
- success
- warning
- error
- Selection
Use Haptica with UIButtons by setting isHaptic
to true and setting the haptic feedback type (hapticType
) to the desired type (.impact(.light)
).
button.isHaptic = true
button.hapticType = .impact(.light)
var isHaptic: Bool // enables haptic feedback
var hapticType: Haptic? // haptic feedback type
var hapticControlEvents: UIControlEvents? // haptic feedback control events
To install with CocoaPods, simply add this in your Podfile
:
use_frameworks!
pod "Haptica"
To install with Carthage, simply add this in your Cartfile
:
github "efremidze/Haptica"
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
Haptica is available under the MIT license. See the LICENSE file for more info.