Latest 0.1.0
Homepage https://github.com/lacklock/ZHStatusVolume
License MIT
Platforms ios 7.0, requires ARC
Frameworks MediaPlayer, AVFoundation
Authors

CocoaPods

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

ZHStatusVolume

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

Latest podspec

{
    "name": "ZHStatusVolume",
    "version": "0.1.0",
    "summary": "hide system volume hud, display upon status bar",
    "description": "hide system volume hud, display upon status bar.",
    "homepage": "https://github.com/lacklock/ZHStatusVolume",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "lacklock": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lacklock/ZHStatusVolume.git",
        "tag": "0.1.0"
    },
    "source_files": "ZHStatusVolume/**",
    "frameworks": [
        "MediaPlayer",
        "AVFoundation"
    ],
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This