DEV Community

Coder
Coder

Posted on • Originally published at itscoderslife.wordpress.com on

How to tweak the Volume HUD in iOS?

iOS volume change HUD is a big freaking non interactable rounded rectangle pop up. This obstructs the UI for good 2-3 seconds. This irritates me. So if there are any media apps to be developed use this technique to customize volume change feedback UI.

Now if you are developing an app and need very less irritated users or frustrated users, then never ever use feedback HUDs right in the center of the screen and that too for more than 2-3 seconds.

Now one default such HUD is Volume HUD which comes over all the applications. But good thing is you can customize it.

You need to add just 3 things in your view controller:

  1. Apple’s MediaPlayer framework
  2. A dummy instance of MPVolumeView​ added as a subview of your view
  3. An observer to AVSystemController_AudioVolumeNotificationParameter

The below linked youtube video guides you on how to implment this in your project:

The source code to the sample mentioned in the video is available on Github:

https://github.com/itsdamslife/iOS-Custom-Volume-UI

Share your feedback in here or below the youtube video.

Happy coding πŸ˜‰

Damodar Shenoy's DEV Profile

Advertisements

        __ATA.cmd.push(function() {
            __ATA.initSlot('atatags-26942-5adb57912d977', {
                collapseEmpty: 'before',
                sectionId: '26942',
                width: 300,
                height: 250
            });
        });



        __ATA.cmd.push(function() {
            __ATA.initSlot('atatags-114160-5adb57912d97a', {
                collapseEmpty: 'before',
                sectionId: '114160',
                width: 300,
                height: 250
            });
        });
Enter fullscreen mode Exit fullscreen mode

Top comments (0)