TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2016 |
SPMSupports SPM | ✗ |
Maintained by Bell App Lab.
import UIKit
import Volumer
class ViewController: UIViewController {
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
//Use this if you want the volume buttons to still affect the device's playback volume
//The default is `true`
Volume.keepIntact = false
//Use your own MPVolumeView if you want
//Obs. This method needs to be executed if you have called `Volume.reset()`
Volume.use(self.volumeView)
//Register a volume up block
Volume.when(.Up) {
print("UP!")
}
//Register a volume down block
Volume.Down.when {
print("Down")
}
}
override func viewDidDisappear(animated: Bool) {
//Be sure to call this when you're done
Volume.reset()
super.viewDidDisappear(animated)
}
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 8+
MediaPlayer
NO AVFoundation \o/
Volumer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Volumer"
Bell App Lab, [email protected]
Volumer is available under the MIT license. See the LICENSE file for more info.