All Projects β†’ efremidze β†’ Haptica

efremidze / Haptica

Licence: mit
Easy Haptic Feedback Generator πŸ“³

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Haptica

Peep
Easy Sound Generator πŸ₯
Stars: ✭ 59 (-89.95%)
Mutual labels:  feedback, cocoapods, carthage, generator
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+193.02%)
Mutual labels:  cocoapods, carthage, uibutton
Transitionbutton
UIButton sublass for loading and transition animation.
Stars: ✭ 1,124 (+91.48%)
Mutual labels:  cocoapods, carthage, uibutton
Avsqldebugger
A Simple Core Data Debugger that will look inside your apps DB
Stars: ✭ 30 (-94.89%)
Mutual labels:  apple, cocoapods, carthage
Pdfgenerator
A simple generator of PDF written in Swift.
Stars: ✭ 629 (+7.16%)
Mutual labels:  cocoapods, carthage, generator
Shiny
Iridescent Effect View (inspired by Apple Pay Cash) ✨
Stars: ✭ 707 (+20.44%)
Mutual labels:  apple, cocoapods, carthage
Statusalert
Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.
Stars: ✭ 809 (+37.82%)
Mutual labels:  apple, cocoapods, carthage
Cluster
Easy Map Annotation Clustering πŸ“
Stars: ✭ 1,132 (+92.84%)
Mutual labels:  apple, cocoapods, carthage
Magnetic
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲
Stars: ✭ 1,252 (+113.29%)
Mutual labels:  apple, cocoapods, carthage
Shsearchbar
The search bar that doesn't suck.
Stars: ✭ 206 (-64.91%)
Mutual labels:  apple, cocoapods, carthage
Animoji
Animoji Generator 🦊
Stars: ✭ 277 (-52.81%)
Mutual labels:  apple, cocoapods, carthage
Pinpointkit
Send better feedback
Stars: ✭ 1,115 (+89.95%)
Mutual labels:  feedback, cocoapods, carthage
Ssspinnerbutton
Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a diffrent spinner animations.
Stars: ✭ 357 (-39.18%)
Mutual labels:  cocoapods, carthage, uibutton
Ppcounter
iOS与macOSδΈ­δΈ€ζ¬ΎδΌ˜ι›…ηš„ζ•°ε­—/ι‡‘ι’ε’žε‡εŠ¨ζ•ˆη»„δ»Ά
Stars: ✭ 451 (-23.17%)
Mutual labels:  cocoapods, uibutton
Agrume
πŸ‹ A lemony fresh iOS image viewer written in Swift.
Stars: ✭ 449 (-23.51%)
Mutual labels:  cocoapods, carthage
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+797.27%)
Mutual labels:  cocoapods, carthage
Xmlcoder
Easy XML parsing using Codable protocols in Swift
Stars: ✭ 460 (-21.64%)
Mutual labels:  cocoapods, carthage
Swiftyjson
The better way to deal with JSON data in Swift.
Stars: ✭ 21,042 (+3484.67%)
Mutual labels:  cocoapods, carthage
Pulltodismiss
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.
Stars: ✭ 456 (-22.32%)
Mutual labels:  cocoapods, carthage
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (-2.9%)
Mutual labels:  cocoapods, carthage

Haptica

Build Status Carthage Compatible Language Version License Platform

Haptica is an easy haptic feedback generator.

$ pod try Haptica

Requirements

  • iOS 9.0+
  • Xcode 8.0+
  • Swift 5 (Haptica 3.x), Swift 4 (Haptica 2.x), Swift 3 (Haptica 1.x)

Haptic Feedback Requirements:

  • A device with a supported Taptic Engine.
  • App is running in the foreground.
  • System Haptics setting is enabled.

Usage

Generate using a haptic feedback type.

Haptic.impact(.light).generate()

Feedback Types

  • Impact: (UIImpactFeedbackStyle) - Use impact feedback generators to indicate that an impact has occurred. For example, you might trigger impact feedback when a user interface object collides with something or snaps into place.
    • light
    • medium
    • heavy
  • Notification: (UINotificationFeedbackType) - Use notification feedback to communicate that a task or action has succeeded, failed, or produced a warning of some kind.
    • success
    • warning
    • error
  • Selection - Use selection feedback to communicate movement through a series of discrete values.

Vibration Patterns

Play a custom vibration pattern:

Haptic.play("..oO-Oo..", delay: 0.1)

Use pattern symbols to represent custom vibrations.

  • O - heavy impact
  • o - medium impact
  • . - light impact
  • - - wait 0.1 second

Or play a symphony of notes:

Haptic.play([.haptic(.impact(.light)), .haptic(.impact(.heavy)), .wait(0.1), .haptic(.impact(.heavy)), .haptic(.impact(.light))])

UIButton Extension

To enable haptic feedback on buttons, set these properties:

  • isHaptic - enables haptic feedback
  • hapticType - haptic feedback type
button.isHaptic = true
button.hapticType = .impact(.light)

or use these functions to set the haptic feedback type for control events:

  • addHaptic() - add haptic feedback for control events
  • removeHaptic() - remove haptic feedback for control events
button.addHaptic(.selection, forControlEvents: .touchDown)
button.removeHaptic(forControlEvents: .touchDown)

Functions/Properties

var isHaptic: Bool // enables haptic feedback
var hapticType: Haptic? // haptic feedback type
var hapticControlEvents: UIControl.Event? // haptic feedback control events
func addHaptic(_ haptic: Haptic, forControlEvents events: UIControl.Event) {} // add haptic feedback for control events
func removeHaptic(forControlEvents events: UIControl.Event) {} // remove haptic feedback for control events

Sound Effects

Add sound effects to Haptica using Peep.

Peep.play(sound: KeyPress.tap)

Installation

CocoaPods

To install with CocoaPods, simply add this in your Podfile:

use_frameworks!
pod "Haptica"

Carthage

To install with Carthage, simply add this in your Cartfile:

github "efremidze/Haptica"

Communication

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

Mentions

License

Haptica 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].