![Light Color Theme] (https://s3.postimg.org/j9nktqoyb/Screen_Shot_2016_08_20_at_11_57_53_PM.png) ![Dark Color Theme] (https://s9.postimg.org/osiodktdb/Screen_Shot_2016_08_20_at_11_58_36_PM.png) ![Trimming Audio Clip] (https://s13.postimg.org/6l0g3rop3/Screen_Shot_2016_08_20_at_11_58_57_PM.png)
To run the example project, clone the repo, and run pod install
from the Example directory first.
SwiftySoundRecorder is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SwiftySoundRecorder"
To use the recorder, you need to:
- Create an instance of
SwiftySoundRecorder
:
let recorder = SwiftySoundRecorder()
- Options of the recorder:
- Allow cropping:
recorder.allowCropping = true // or false to disallow
- Set maximum length of duration (in seconds):
recorder.maxDuration = 10 // 10 seconds
; If not set, the recorder will run forever until user stops it - Use the theme colors (.Dark and .Light):
recorder.themeType = .Dark
//
- Implement the delegate methods:
- doneRecordingDidPress(soundRecorder: SwiftySoundRecorder, audioFilePath: String)
- cancelRecordingDidPress(soundRecorder: SwiftySoundRecorder)
- Present the recorder:
presentViewController(recorder, animated: true, completion: nil)
rcholic, ivytony@gmail.com
SwiftySoundRecorder is available under the MIT license. See the LICENSE file for more info.