🎶 Graceful handle the volume changes in your iOS apps like Instagram.
iOS 8+, Objective-C And Swift
pod 'XYVolumeHandler'
In the ViewController you want to be handled,
// ViewController.m
import XYVolumeHandler
override func viewDidLoad() {
super.viewDidLoad()
// Start monitor the volume taps
XYVolumeHandler.sharedInstance().startMonitor()
self.xy_setupVolumeView()
}
now, you are ready to be handled.
If you want to do addition customizable things,
extension ViewController: XYVolumeHandlerCustomizable {
// it you wish to disable the handler in certain viewController
func useSystemVolumeView() -> Bool {
return true
}
func volumeStyle() -> XYVolumeStyle {
// return a different style than default style
}
}
MIT