Latest 1.0.0
Homepage https://github.com/KaneCheshire/Feedback
License MIT
Platforms ios 8.0
Frameworks UIKit, AVFoundation
Authors

Feedback

CI Status
Version
License
Platform

The easiest way to provide feedback in the form of haptics and sounds for your users.

Overview

Feedback is an evolution of my other pod, HapticGenerator. Just like HapticGenerator,
Feedback provides an easy and coherent way to generate different types of haptic feedback.
Feedback goes a step further and allows you to also play sound as feedback, either with
or without accompanying haptics.

Feedback comes with a few default sounds, courtesy of Facebook’s Sound Kit, but also has
an option to allow you to use custom sounds, which means it will work with any brand.

Installation

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

pod "FeedbackGenerator"

Usage

Using Feedback, just like HapticGenerator, is incredibly simple. You can create generators that
provide just haptics, haptics and sound, or just sound.

Here’s how to create a feedback generator that provides has a "success" haptic:

let successGenerator = Feedback(hapticType: .notification(.success))

Here’s how to create a feedback generator that just provides a default "error" sound:

let errorGenerator = Feedback(soundType: .notification(.error))

Here’s how to create a feedback generator that provides both a haptic and a sound:

let selectionGenerator = Feedback(hapticType: .selection, soundType: .selection)

Once you’ve created your generator, all you have to do to generate the feedback is this:

selectionGenerator.generateFeedback()

Optionally, if you know in advance when your feedback is likely to be generated, you
can prepare the system for its use:

selectionGenerator.prepareForUse()

You can also provide the name of a custom sound file to use with or without haptics:

let customSoundWithHaptic = Feedback(hapticType: .impact(.light), soundType: .custom(soundName: "customFileName", extension: "mp3"))

Requirements

Feedback works as far back as iOS 8, but haptics will only play on supported devices running iOS 10 or newer.
Under the hood, Feedback uses UIKit and AVFoundation.

Author

@kanecheshire

License

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

Latest podspec

{
    "name": "FeedbackGenerator",
    "version": "1.0.0",
    "summary": "Feedback is a small and easy to use wrapper, for generating different styles of feedback in the form of haptics, sounds, or both.",
    "description": "Feedback is a really easy way to provide nuanced and helpful feedback to your users on iOS.nFeedback comes in the form of haptics, or sounds, or both. With Feedback you can use the defaultnsounds for different types of feedback, or provide a custom sound to use.",
    "homepage": "https://github.com/KaneCheshire/Feedback",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kane Cheshire": "[email protected]"
    },
    "source": {
        "git": "https://github.com/KaneCheshire/Feedback.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/kanecheshire",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Feedback/Classes/**/*",
    "resource_bundles": {
        "FeedbackAssets": [
            "Feedback/Assets/*.m4a"
        ]
    },
    "frameworks": [
        "UIKit",
        "AVFoundation"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This