Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

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

Topics

Resources

License

Packages

No packages published