zhs

ZHStatusVolume

[iOS] hide system volume hud, display upon status bar

Showing:

Popularity

Downloads/wk

0

GitHub Stars

47

Maintenance

Last Commit

4yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Categories

Readme

ZHStatusVolume

CocoaPods

Hide system volume hud, display upon status bar.Compatible with swift.

Usage

1.Setup

Use default volume view:

[ZHStatusVolumeManager register:nil];

//config volume view style
 ZHStatusVolumeManager.barBackgroundColor = [UIColor whiteColor];
 ZHStatusVolumeManager.indicatorTintColor = [UIColor darkGrayColor];

Custom volume view:

implement a UIView conform to protocol ZHVolumeView :

@protocol ZHVolumeView

- (void)setCurrentVolume:(float)volume;
- (void)volumeUpdated:(float)volume;

- (CGFloat)viewHeight;

@end

then register with custom view instance:

import ZHStatusVolume

let customeView = Bundle.main.loadNibNamed("CustomVolumeView", owner: nil, options: nil)?.first as! CustomVolumeView
ZHStatusVolumeManager.register(customeView)

2.Start it

// volume changed view will only display upon status bar
[ZHStatusVolumeManager addCustomVolumeView];

3.Stop

If you only need some pages hide system volume hud, you could call this method to back to standard way.

// back to standard way
[ZHStatusVolumeManager removeVolumeView];

Installation

CocoaPods:

pod 'ZHStatusVolume'

Beware

Get volume by using AVAudioSession, so during status volume work, codebase will set AVAudioSession active.

Todo

Support rotating screen.

微博

@没故事的卓同学

Thanks

JDStatusBarNotification

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100