CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

Volumer 0.1.1

Volumer 0.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2016
SPMSupports SPM

Maintained by Bell App Lab.



Volumer 0.1.1

  • By
  • Bell App Lab

Volumer

Usage

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.

Requirements

iOS 8+

MediaPlayer

NO AVFoundation \o/

Installation

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

pod "Volumer"

Author

Bell App Lab, [email protected]

License

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