https://github.com/kharauzov/tapticeffects
Class, that enables to call easily functional, built in Taptic Engine & Haptic Feedback.
https://github.com/kharauzov/tapticeffects
engine haptic haptics ios swift taptic
Last synced: about 1 year ago
JSON representation
Class, that enables to call easily functional, built in Taptic Engine & Haptic Feedback.
- Host: GitHub
- URL: https://github.com/kharauzov/tapticeffects
- Owner: Kharauzov
- License: mit
- Created: 2017-10-19T15:27:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-10T11:55:11.000Z (over 8 years ago)
- Last Synced: 2025-04-23T21:02:12.370Z (about 1 year ago)
- Topics: engine, haptic, haptics, ios, swift, taptic
- Language: Swift
- Size: 5.86 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TapticEffects
Easily generate vibrations, built in Taptic Engine & Haptic Feedback at your iOS apps.


[](https://doge.mit-license.org)
## Overview
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](https://developer.apple.com/reference/uikit/uinotificationfeedbackgenerator), [UISelectionFeedbackGenerator](https://developer.apple.com/reference/uikit/uiselectionfeedbackgenerator), [UIImpactFeedbackGenerator](https://developer.apple.com/reference/uikit/uiimpactfeedbackgenerator).
## Usage
TapticEffects class doesn't require any initialization at your project. You can call its methods from any place using type methods of class.
```swift
/// 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
```
## Requirements
- Swift 3.0+
- iOS 10.0+
- iPhone 6s or higher
## Installation
### Manually
Just download and drop `TapticEffectsService.swift` class into your project.
## License
TapticEffects is available under the MIT license. See the LICENSE file for more info.