Skip to content
This repository was archived by the owner on Jan 23, 2020. It is now read-only.

gizmosachin/VolumeBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Deprecated

VolumeBar is now deprecated. iOS now includes a non-intrusive volume indicator, so apps should stop using VolumeBar.

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 5

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

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

pod 'VolumeBar', '~> 3.1'
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.

About

πŸ“£ Volume indicator that doesn't obstruct content

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •