Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bellapplab/volumer
A Swifty way to take control over the volume buttons on iOS.
https://github.com/bellapplab/volumer
Last synced: about 2 months ago
JSON representation
A Swifty way to take control over the volume buttons on iOS.
- Host: GitHub
- URL: https://github.com/bellapplab/volumer
- Owner: BellAppLab
- License: mit
- Created: 2015-11-16T18:11:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-05T02:19:40.000Z (over 1 year ago)
- Last Synced: 2024-10-12T15:33:39.522Z (3 months ago)
- Language: Swift
- Size: 35.2 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Volumer
A Swifty way to take control over the volume buttons on iOS.
_v0.2.0_
## Usage
```swift
class ViewController: UIViewController {override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)//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 finished
Volume.reset()
super.viewDidDisappear(animated)
}}
```## Requirements
- iOS 8+
- MediaPlayer.framework
- **NO AVFoundation** \o/## Installation
### Cocoapods
Because of [this](http://stackoverflow.com/questions/39637123/cocoapods-app-xcworkspace-does-not-exists), I've dropped support for Cocoapods on this repo. I cannot have production code rely on a dependency manager that breaks this badly.
### Git Submodules
**Why submodules, you ask?**
Following [this thread](http://stackoverflow.com/questions/31080284/adding-several-pods-increases-ios-app-launch-time-by-10-seconds#31573908) and other similar to it, and given that Cocoapods only works with Swift by adding the use_frameworks! directive, there's a strong case for not bloating the app up with too many frameworks. Although git submodules are a bit trickier to work with, the burden of adding dependencies should weigh on the developer, not on the user. :wink:
To install Volumer using git submodules:
```
cd toYourProjectsFolder
git submodule add -b submodule --name Volumer https://github.com/BellAppLab/Volumer.git
```**Swift 2 support**
```
git submodule add -b swift2 --name BLLogger https://github.com/BellAppLab/BLLogger.git
```Then, navigate to the new Volumer folder and drag the `Source` folder to your Xcode project.
## Author
Bell App Lab, [email protected]
## License
Volumer is available under the MIT license. See the LICENSE file for more info.