Cool Animated music indicator view written in Swift

Related tags

UI ESTMusicIndicator
Overview

GA

Cool Animated music indicator view written in Swift.

ESTMusicIndicator is an implementation of NAKPlaybackIndicatorView in Swift for iOS 8.

MusicIndicator

You may interested in my other project

Requirements

  • An iPhone/iPad running iOS 8.0+
  • Xcode 7.0 or above

Screenshots

MusicIndicator

Run the Demo

$ open Example/ESTMusicIndicator.xcodeproj

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

$ gem install cocoapods

To integrate ESTMusicIndicatorView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'ESTMusicIndicator'

Then, run the following command:

$ pod install

You can check out this link for more information about how to use CocoaPods.

Manually

  1. Clone this project or download it.
  2. Drag and drop Classes folder to your workspace

Usage

Simple Example:

let indicator = ESTMusicIndicatorView.init(frame: CGRect.zero)
indicator.tintColor = .red
indicator.sizeToFit()
view.addSubview(indicator)

Initially the state property is ESTMusicIndicatorViewStateStopped and the hidesWhenStopped property is YES. Thus, the view is hidden at this time.

The view appears and the bars start animation.

indicator.state = .playing;

The bars stop animation and become idle.

indicator.state = .paused;

The view becomes hidden.

indicator.state = .stopped;

You can use ESTMusicIndicatorView in both code and Storyboard, and it works well with both Auto Layout and frame-based layout.

Code with Auto Layout

let indicator = ESTMusicIndicatorView.init(frame: CGRect.zero)
indicator.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(indicator)

Then, add some positioning layout constraints. Note that normally you don't need to add sizing constraints since ESTMusicIndicatorView has an intrinsic content size. It will be automatically resized to fit its content.

Code with Frame-Based Layout

let indicator = ESTMusicIndicatorView.init(frame: CGRect.zero)
view.addSubview(indicator)
indicator.sizeToFit() // Resize itself to fit its content.

Customization

Color

The color of the bars can be changed by setting tintColor property (UIView) of the view or its ancestor view.

Size

Normally the view can be automatically resized to fit its content by:

  • Omitting sizing constraints in Auto Layout, since it has an intrinsic content size.
  • Calling sizeToFit in frame-based layout.

Or if you explicitly specify size, the bars will be placed in the center of the view.

Contact

You can ping me on Twitter or follow me on Weibo If you find an issue.

Contributing

Thank you for your interest in contributing to Hodor! Your ideas for improving this app are greatly appreciated. The best way to contribute is by submitting a pull request. I'll do my best to respond to you as soon as possible. You can also submit a new GitHub issue if you find bugs or have questions.

Thanks for

License

Copyright (c) 2017-2018 Paul King

Released under the MIT license

Comments
  • Help!

    Help!

    Hello! Your program is very well done. Thanks very much for you sharing,but I found a problem in the test. In this program you have set up ten rows of data,and it works well.But if I set up more rows of data,for example eighty rows, when it works,I click on the first line,I find the first line,the fifteenth line ,the twenty-ninth line,the forty-third line,the fifty-seventh line and the seventy-first line indicators are all Animating. This is wrong,Please help!

    opened by liuyiyi2016 2
  • Mark NSNotification callback methods with @objc.

    Mark NSNotification callback methods with @objc.

    Currently the app crashes with 'unrecognized selector sent to instance' exception. Mark applicationWillEnterForeground: method with @objc so method is exposed to Objective-C.

    Stop all animations explicitly in new applicationDidEnterBackground: method so it logically pairs with applicationWillEnterForeground: . Also it works great if animations are not suspended by Apple for some reason/different iOS version.

    opened by genkernel 2
  • Remove kBarMin/MaxPeakHeight constants and use view's height as maxPeakHeight.

    Remove kBarMin/MaxPeakHeight constants and use view's height as maxPeakHeight.

    Use frame's height value as maxPeakHeight to allow developer to resize ESTMusicIndicator externally(e.g. storyboard) without changing internal constants.

    opened by genkernel 2
  • migrated to swift 4

    migrated to swift 4

    • updated project settings
    • changed UILayoutPriorityDefaultHigh to UILayoutPriority.defaultHigh
    • changed SWIFT_SWIFT3_OBJC_INFERENCE to default in target settings
    • added @objc to didTapIndicator gesture recognizer
    opened by helkarli 1
  • Ability to change number of bars

    Ability to change number of bars

    kBarCount is a constant. It would be really nice to be able to change that. In our app, in one place we'd like 3 bars, in another place we'd like 4 bars.

    opened by hipwelljo 1
  • iOS 10 issue

    iOS 10 issue

    @Aufree
    Hello, I have 20 static cells in table view and when state == .playing and bars are animating and when I scroll down and go up bars are no longer animating and they in pause mode iOS 8.4 has no problems with it Any idea how can I fix this ?

    Thanks!

    opened by yarodevuci 3
Owner
Aufree
Live a life you will remember.
Aufree
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Jogendra 772 Dec 28, 2022
Circular progress indicator for your macOS app

CircularProgress Circular progress indicator for your macOS app This package is used in production by apps like Gifski and HEIC Converter. Requirement

Sindre Sorhus 520 Jan 3, 2023
Snapchat / Instagram Stories like progress indicator

SegmentedProgressBar A simple little control that animates segments like Snapchat or Instagram Stories. Requirements iOS 8.0+ Xcode 8 Installation Dra

Dylan Marriott 442 Dec 25, 2022
A library to recreate the iOS Apple Music now playing transition

DeckTransition DeckTransition is an attempt to recreate the card-like transition found in the iOS 10 Apple Music and iMessage apps. Hereʼs a GIF showi

Harshil Shah 2.2k Dec 15, 2022
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲

Magnetic Magnetic is a customizable bubble picker like the Apple Music genre selection. Demo Video $ pod try Magnetic Features Adding/Removing Nodes

Lasha Efremidze 1.4k Jan 6, 2023
A modern HUD inspired by Apple Music and Apple Podcasts

HUD A modern HUD inspired by Apple Music and Apple Podcasts. Appearance Light Dark HUD Activity Indicator HUD Requirements iOS 13+ Installation You ca

Bei Li 30 Nov 18, 2022
Beautiful animated placeholders for showing loading of data

KALoader Create breautiful animated placeholders for showing loading of data. You can change colors like you want. Swift 4 compatible. Usage To add an

Kirill Avery 105 May 2, 2022
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

Mukesh Thawani 467 Dec 5, 2022
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction ?? Awesome search view, written in Swift 5.0, appears search view like Pinteres

Kyle Yi 1.2k Dec 17, 2022
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

Mukesh Thawani 466 Nov 9, 2021
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Or Ron 234 Nov 22, 2022
🏞 A simple iOS photo and video browser with optional grid view, captions and selections written in Swift5.0

Introduction ?? MediaBrowser can display one or more images or videos by providing either UIImage objects, PHAsset objects, or URLs to library assets,

Kyle Yi 631 Dec 29, 2022
🚀 Elegant Pager View fully written in pure SwiftUI.

PagerTabStripView Made with ❤️ by Xmartlabs team. XLPagerTabStrip for SwiftUI! Introduction PagerTabStripView is the first pager view built in pure Sw

xmartlabs 482 Jan 9, 2023
Show the weather effects onto view written in Swift4.2

URWeatherView What is this for? Showing some kinds of the weather effect, written in Swift4.2. This code style is the Protocol Oriented Programming. T

Urtaq 449 Dec 28, 2022
Swift based simple information view with pointed arrow.

InfoView View to show small text information blocks with arrow pointed to another view.In most cases it will be a button that was pressed. Example To

Anatoliy Voropay 60 Feb 4, 2022
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.5k Jan 5, 2023
A Swift material design UI module which paints over the parent view when the switch is on.

:octocat: ?? RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion

Ramotion 2.9k Dec 29, 2022
🎨 View instance initializing sugar for Swift & UIKit

?? View instance initializing sugar for Swift & UIKit

Yongjun Lee 11 Dec 1, 2022
A nice iOS View Capture Swift Library which can capture all content.

SwViewCapture A nice iOS View Capture Library which can capture all content. SwViewCapture could convert all content of UIWebView to a UIImage. 一个用起来还

Xing Chen 597 Nov 22, 2022