All Projects β†’ iSapozhnik β†’ Haptico

iSapozhnik / Haptico

Licence: mit
Haptico πŸ“³ - easy to use haptic feedback generator with pattern-play support

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Haptico

Vue Touch Keyboard
Virtual keyboard component for Vue.js 2.x. Designed to Raspberry Pi Touch Display
Stars: ✭ 255 (-40.14%)
Mutual labels:  touch
Croppr.js
A vanilla JavaScript image cropper that's lightweight, awesome, and has absolutely zero dependencies.
Stars: ✭ 294 (-30.99%)
Mutual labels:  touch
Pull To Reload
Pull to reload implementation for the web. Designed to work with both mobile and websites.
Stars: ✭ 396 (-7.04%)
Mutual labels:  touch
Ctfeedback
Library to send feedback for iOS. Swift version https://github.com/rizumita/CTFeedbackSwift
Stars: ✭ 262 (-38.5%)
Mutual labels:  feedback
Framework7
Full featured HTML framework for building iOS & Android apps
Stars: ✭ 16,560 (+3787.32%)
Mutual labels:  touch
Moufette
🦨 Moufette is developer-friendly, open-source set of tools to collect users feedback. Find us on Twitter @MoufetteHQ
Stars: ✭ 303 (-28.87%)
Mutual labels:  feedback
Pancake
Lightweight, Fast, Easy-to-use HTML5 2D game framework!
Stars: ✭ 79 (-81.46%)
Mutual labels:  touch
Creepyface
A JavaScript library that makes your face follow the pointer. πŸ€ͺπŸ–±οΈπŸ‘†
Stars: ✭ 412 (-3.29%)
Mutual labels:  touch
Forem
For empowering community 🌱
Stars: ✭ 18,400 (+4219.25%)
Mutual labels:  feedback
Managers Playbook
πŸ“– Heuristics for effective management
Stars: ✭ 4,504 (+957.28%)
Mutual labels:  feedback
Phytouch
Smooth scrolling, rotation, pull to refresh, page transition and any motion for the web - δΈθˆ¬ι‘Ίζ»‘ηš„θ§¦ζ‘ΈθΏεŠ¨ζ–Ήζ‘ˆ
Stars: ✭ 2,854 (+569.95%)
Mutual labels:  touch
Cupertino Pane
πŸŽ‰πŸ“±Multi-functional panes and boards for next generation progressive applications
Stars: ✭ 267 (-37.32%)
Mutual labels:  touch
Alloyfinger
Super tiny size multi-touch gestures library for the web. γ€€γ€€γ€€You can touch this β†’
Stars: ✭ 3,244 (+661.5%)
Mutual labels:  touch
Hover On Touch
A pure Javascript Plugin for an alternative hover function that works on mobile and desktop devices. It triggers a hover css class on Β»TapholdΒ« and goes to a possible link on Β»TapΒ«. It works with all html elements.
Stars: ✭ 256 (-39.91%)
Mutual labels:  touch
Vue Gallery
πŸ“· Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.
Stars: ✭ 405 (-4.93%)
Mutual labels:  touch
postcss-momentum-scrolling
PostCSS plugin add 'momentum' style scrolling behavior (-webkit-overflow-scrolling: touch) for elements with overflow (scroll, auto) on iOS
Stars: ✭ 69 (-83.8%)
Mutual labels:  touch
Mtmr
🌟 [My TouchBar My rules]. The Touch Bar Customisation App for your MacBook Pro
Stars: ✭ 3,547 (+732.63%)
Mutual labels:  touch
Better Gesture
A gesture library use for pc, mobile, vue, and mini programs
Stars: ✭ 419 (-1.64%)
Mutual labels:  touch
Notebook
my notebook πŸ“’
Stars: ✭ 405 (-4.93%)
Mutual labels:  touch
Httptoolkit
HTTP Toolkit is a beautiful & open-source tool for debugging, testing and building with HTTP(S) on Windows, Linux & Mac πŸŽ‰
Stars: ✭ 331 (-22.3%)
Mutual labels:  feedback

Haptico

Haptico is easy to use iOS haptic feedback generator. Besides default haptic feedbacks it can play patterns! Checkout Example project.

CI Status Version License Platform

Table of contents

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

How to use

First of all you will need to import Haptico module into your class:

import Haptico

Also keep in mind that depending on the device you are using - the feedback might be different. Starting from iPhone 7 all the iPhones are coming with haptic engine. Prior to iPhone 7 Haptico will use standard vibration. Also Pattern play and impacts are not supported on devices prior to iPhone 7 and iOS 10

1. Generating predefined default feedbacks.

With Haptico you can generate three default types of haptic notifications:

public enum HapticoNotification {
    case success
    case warning
    case error
}

Here is small example how can you generate Success, Warning and Error feedbacks:

@IBAction func generateSuccess(_ sender: Any) {
    Haptico.shared().generate(.success)
}
@IBAction func generateWarning(_ sender: Any) {
    Haptico.shared().generate(.warning)
}
@IBAction func generateError(_ sender: Any) {
    Haptico.shared().generate(.error)
}

2. Generating impact feedbacks

Besides default haptic notifications, Haptico can also generate impact notifications. The library supports three types of impact notifications (available in iOS10+ and staring from iPhone 7):

public enum HapticoImpact {
    case light
    case medium
    case heavy
}

And to use them call:

Haptico.shared().generate(.medium)

Easy, huh?

3. Pattern play

And now something special - Pattern Play. Haptico can play patterns, "coded" as String. Let's take a look at small example:

Haptico.shared().generateFeedbackFromPattern("..oO-Oo..", delay: 0.1)

Each character in this string represents some specific haptic impact:

  • "O" (capital "o") - heavy impact
  • "o" - medium impact
  • "." - light impact
  • "-" - delay which has duration of 0.1 second

4. UI extensions

Haptico comes with a couple of UI Extensions: HapticoButton (which is subclass of UIButton) and UIAlertController extension with haptic feedback.

In order to start using HapticoButton - just set the class name in your Storyboard to HapticoButton. Then with UIControlEvents.touchDown event you will get heavy impact feedback and with UIControlEvents.touchUpInside and UIControlEvents.touchUpOutside you will get light impact feedback.

To use Haptico together with UIAlertController follow this simple example:

func showSuccessAlert() {
    let alert = UIAlertController(title: "Alert Title", message: "Alert Message", preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
    present(alert, animated: true, hapticNotification: .success)
}

Installation

Haptico is available through CocoaPods, Carthage and Swift Package Manager.

Cocoapods

To install it using CocoaPods, simply add the following line to your Podfile:

pod 'Haptico'

Carthage

To install it via Carthage, add the following line to your Cartfile and follow the instructions to adding frameworks to an application:

github "iSapozhnik/Haptico"

Swift Package Manager

To install it using the Swift Package Manager, either directly add it to your project using Xcode 11, or specify it as dependency in the Package.swift file:

// ...
dependencies: [
    .package(url: "https://github.com/iSapozhnik/Haptico.git", from: "1.1.0"),
],
//...

Mentions

Author

isapozhnik, [email protected]

Donation

If you like this project and it helps you to reduce time to develop, you can give me a cup of β˜•οΈ πŸ˜‰

Donate

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].