Audio Indicator Bars

Tuesday, 20 September 2016

AIB indicates for your app users which audio is playing, just like the Podcasts app. It works for iOS and tvOS.

Requirements and Details

  • iOS 9.0+ / tvOS 9.0+
  • Xcode 8.0+
  • Built with Swift 3.0

Installation

CocoaPods

To use AudioIndicatorBars as a pod package just add the following in your Podfile file.


source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Your Target Name' do
    use_frameworks!
    // ...
    pod 'AudioIndicatorBars', '~> 0.0.1'
    // ...
end

Carthage

To use AudioIndicatorBars as a Carthage module package just add the following in your Cartfile file.


// ...
github "LeonardoCardoso/AudioIndicatorBars" ~> 0.0.1
// ...

Manually

You just need to drop AudioIndicatorBars folder into Xcode project (make sure to enable “Copy items if needed” and “Create groups”).

Usage

Instantiating

1. Programmatically


let indicator = AudioIndicatorBarsView(
                    rect: CGRect,
                    barsCount: Int,
                    cornerRadius: CGFloat,
                    color: UIColor
                 )

2. Interface Builder

Interface Builder Setup 1 Interface Builder Setup 2 Interface Builder Setup 3

Interface Builder Setup 4

This GIF is not as smooth as it really is. You can check the videos on GitHub.

Here are some possibilities.

Interface Builder Setup 5

Actions

Start


indicator.start()

Stop


indicator.stop()

License

The MIT License


This code is also available on my GitHub profile.

Clipboarded »