Skip to content

Class, that enables to call easily functional, built in Taptic Engine & Haptic Feedback.

License

Notifications You must be signed in to change notification settings

Kharauzov/TapticEffects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

TapticEffects

Easily generate vibrations, built in Taptic Engine & Haptic Feedback at your iOS apps.

Swift Platform License

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, UISelectionFeedbackGenerator, 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.

/// 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.

About

Class, that enables to call easily functional, built in Taptic Engine & Haptic Feedback.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages