Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.43 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.43 KB

SwishControl

CI Status Version License Platform

SwishControl is a category on UIControl for adding sound effects to UIControlEvents.

Usage

Import the SwishControl header

#import <SwishControl/SwishControl.h>

SwishControl uses AudioToolbox which supports aif, caf and wav.
This is how you add a sound effect for all UIButtons

NSString *clickPath = [[NSBundle mainBundle] pathForResource:@"click" ofType:@"aif"];
[[UIButton appearance] bs_setAudioWithPath:clickPath forEvent:UIControlEventTouchUpInside];

Of course it can be applied to a single UIControl as well, if you don't want to set a sound for all of them.

Requirements

iOS, bananas and a bunch of sound effects

Installation

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

pod "SwishControl"

Author

Joakim Gyllström

License

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