RomanTruba / DAProgressOverlayView

Layer-based version with CABasicAnimation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DAProgressOverlayView

A UIView subclass displaying download progress. Looks similarly to springboard icons of apps being downloaded in iOS 7.

Animated example

Installing

You can install the library with Cocoapods

platform :ios, '5.0'
pod "DAProgressOverlayLayeredView"

Usage

  1. Create overlay view with your view bounds, and add it:
self.progressOverlayView = [[DAProgressOverlayView alloc] initWithFrame:self.imageView.bounds]; //Create new view
[self.imageView addSubview:self.progressOverlayView]; //Add as subview
[self.progressOverlayView displayOperationWillTriggerAnimation]; //Play start animation
  1. Update overlay progress level:
self.progressOverlayView.progress = progress;
  1. Catch animation finish:
__weak DAViewController *wself = self;
[self.progressOverlayView setAnimationCompletionHandler:^(DAProgressOverlayAnimationType type) {
    if (type == DAProgressOverlayAnimationFinish) {
        wself.progressOverlayView = nil;
    }
}];

About

Layer-based version with CABasicAnimation

License:MIT License


Languages

Language:Objective-C 96.1%Language:Ruby 3.9%