πŸ“£ Volume indicator that doesn't obstruct content
Clone or download
Latest commit e955324 Nov 27, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sample Support Swift 4.2 Oct 8, 2018
Sources Support Swift 4.2 Oct 8, 2018
VolumeBar Bump Swift version in project Oct 8, 2018
docs Update docs Mar 13, 2018
.gitignore Initial commit Mar 6, 2016
.travis.yml Support Swift 4.2 Oct 8, 2018
CONTRIBUTING.md Update README Mar 13, 2018
Gemfile Update Jazzy Oct 8, 2018
Gemfile.lock Update Jazzy Oct 8, 2018
LICENSE.txt Initial commit Mar 6, 2016
README.md Made customStyle a variable Nov 24, 2018
VolumeBar.gif Reduce whitespace in gif Mar 6, 2016
VolumeBar.podspec Support Swift 4.2 Oct 8, 2018
build_docs.sh Update docs Mar 13, 2018

README.md

VolumeBar

VolumeBar

VolumeBar is a Swift volume indicator that doesn't obstruct content on screen.

Build Status Pod Version Swift Version GitHub license

Features
πŸ™… Hides system volume HUD automatically
🎨 Customizable appearance with presets
πŸ’₯ Support for custom animations
πŸ“± Works with iPhone X
πŸ“š Fully documented
🐀 Swift 4

Usage

It's super easy to add VolumeBar to your app:

let volumeBar = VolumeBar.shared
volumeBar.style = .likeInstagram
volumeBar.start()

Customize appearance attributes (see VolumeBarStyle):

let volumeBar = VolumeBar.shared
var customStyle = VolumeBarStyle.likeInstagram
customStyle.trackTintColor = .white
customStyle.trackTintColor = .darkGray
customStyle.backgroundColor = .black
volumeBar.style = customStyle

Or even use custom animations (see VolumeBarAnimation):

let volumeBar = VolumeBar.shared
let fadeInAnimation = VolumeBarAnimation({ (view, completion) in
	view.alpha = 0
	UIView.animate(withDuration: 0.2, animations: {
		view.alpha = 1
	}, completion: completion)
})
volumeBar.showAnimation = fadeInAnimation

Background Audio

If your app doesn't do custom audio handling, adding VolumeBar will make background music (like Spotify) pause when your app is opened.

Prevent this by adding the following wherever you call VolumeBar.shared.start():

try! AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient)

VolumeBar

VolumeBar is fully documented here.

Installation

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

pod 'VolumeBar', '~> 3.0.4'

Carthage

github "gizmosachin/VolumeBar" "master"

Sample

Please see the Sample directory for a basic iOS project that uses VolumeBar.

Contributing

VolumeBar is a community - contributions and discussions are welcome!

Please read the contributing guidelines prior to submitting a Pull Request.

License

VolumeBar is available under the MIT license, see the LICENSE file for more information.