GithubHelp home page GithubHelp logo

matteocrippa / tapticengine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from worlddowntown/tapticengine

0.0 3.0 0.0 70 KB

TapticEngine generates haptic feedback vibrations on iOS device.

License: MIT License

Swift 82.46% Ruby 17.54%

tapticengine's Introduction

TapticEngine

License Swift Carthage compatible CocoaPods compatible Downloads with CocoaPods Awesome

Overview

TapticEngine generates haptic feedback vibrations on iOS device. This library wrapps on UIImpactFeedbackGenerator, UISelectionFeedbackGenerator, UINotificationFeedbackGenerator.

demo_screenshot

Demo

Build Xcode project.

  1. Open TapticEngine.xcodeproj.
  2. Change Scheme to TapticEngineDemo
  3. Run

Usage

// Triggers an impact feedback between small, light user interface elements. (`UIImpactFeedbackStyle.light`)
TapticEngine.impact.feedback(.light)

// Triggers an impact feedback between moderately sized user interface elements. (`UIImpactFeedbackStyle.medium`)
TapticEngine.impact.feedback(.medium)

// Triggers an impact feedback between large, heavy user interface elements.  (`UIImpactFeedbackStyle.heavy`)
TapticEngine.impact.feedback(.heavy)

// Triggers a selection feedback to communicate movement through a series of discrete values.
TapticEngine.selection.feedback()

// Triggers a notification feedback, indicating that a task has completed successfully. (`UINotificationFeedbackType.success`)
TapticEngine.notification.feedback(.success)

// Triggers a notification feedback, indicating that a task has produced a warning. (`UINotificationFeedbackType.warning`)
TapticEngine.notification.feedback(.warning)

// Triggers a notification feedback, indicating that a task has failed. (`UINotificationFeedbackType.error`)
TapticEngine.notification.feedback(.error)

// Prepare an impact feedback for `UIImpactFeedbackStyle.light`.
TapticEngine.impact.prepare(.light)

// Prepare a selection feedback.
TapticEngine.selection.prepare()

// Prepare a notification feedback.
TapticEngine.notification.prepare()

Requirements

  • Swift 4.0+
  • iOS 9.0+ (But it works on iOS 10 or later. On iOS 9, it does nothing.)

Installation

Carthage

TapticEngine is available through Carthage. To install it, simply add the following line to your Cartfile:

github "WorldDownTown/TapticEngine"

CocoaPods

TapticEngine is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TapticEngine'

Manually

Download and drop TapticEngine/Sources folder in your project.

Author

WorldDownTown, [email protected]

License

TapticEngine is available under the MIT license. See the LICENSE file for more info.

tapticengine's People

Contributors

worlddowntown avatar

Watchers

Matteo Crippa avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.