DACircularProgress is a UIView subclass with circular UIProgressView properties.

Overview

DACircularProgress

DACircularProgress is a UIView subclass with circular UIProgressView properties.

It was originally built to be an imitation of Facebook's photo progress indicator.

View the included example project for a demonstration.

Installation

To use DACircularProgress:

  • Copy over the DACircularProgress folder to your project folder.
  • Make sure that your project includes <QuartzCore.framework>.
  • #import "DACircularProgressView.h"

Example Code

self.progressView = [[DACircularProgressView alloc] initWithFrame:CGRectMake(140.0f, 30.0f, 40.0f, 40.0f)];
self.progressView.roundedCorners = YES;
self.progressView.trackTintColor = [UIColor clearColor];
[self.view addSubview:self.progressView];
  • You can also use Interface Builder by adding a UIView element and setting its class to DACircularProgress

Notes

Compatibility

iOS5.0+

Automatic Reference Counting (ARC) support

DACircularProgress was made with ARC enabled by default.

Contact

If you use/enjoy DACircularProgress, let me know!

Credits

DACircularProgress is brought to you by Daniel Amitay and contributors to the project. A special thanks to Cédric Luthi for a significant amount of changes. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by creating new issues.

License

MIT License

Copyright (c) 2013 Daniel Amitay (http://danielamitay.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • trackTintColor and progressTintColor does not work on table cell

    trackTintColor and progressTintColor does not work on table cell

    I customize a table cell and put the circular progress on the cell, then I set the trackTintColor, progressTintColor and the roundedCorners, but all these doesn't work,the circular progress's progressTintColor still is white, I don't know why.

    opened by cssmhyl 5
  • Start at 0%

    Start at 0%

    -DACircularProgressView.m

    -(float)progress { if(!_progress){ _progress = 0.001f; } return _progress; }

    this makes it start out with the smallest possible amount of the circle filled in. Oddly just using 0 doesnt work.

    opened by travisjbeck 4
  • track tint colour does not work on iPad air.

    track tint colour does not work on iPad air.

    This is quite strange. I cannot set the track tint colour when running the app on an iPad air. To get it to work, I renamed the property in the class.

    opened by ManjitBedi 3
  • Empty circularProgress when 100%

    Empty circularProgress when 100%

    I was experiencing an empty circularProgress when setting 100% changing the arc initialization to CGFloat radians = DEGREES_2_RADIANS((self.progress*360.0f)+270); appeared to fix the issue

    opened by mrwanny 3
  • Indeterminate speed on instantiation

    Indeterminate speed on instantiation

    I'm noticing that if I create a progress view and set the "indeterminate" property to YES then it spins about 4x faster than normal. So I have something like:

    DACircularProgressView *progressView = [[DACircularProgressView alloc] initWithFrame:CGRectMake(50, 50, 50, 50)];
    progressView.roundedCorners = YES;
    progressView.progress = 0.65;
    progressView.indeterminate = YES;
    [self.view addSubview:progressView];
    

    But if I set the indeterminate property to YES a few seconds later then it adjusts down to the correct speed. Any ideas on how I can instantiate the view in indeterminate mode without it spinning super fast?

    opened by AcidicSkittles 2
  • Fixes flicker when progress animation completes

    Fixes flicker when progress animation completes

    This fixes the flicker seen when the progress animation completes, as mentioned in issue #30. The way your example project is currently setup, you don't actually see the flicker. Here's how you can test it:

    I'm using iOS7 base SDK and iPhone Retina (4-inch 64-bit) simulator. In ViewController.m comment out [self startAnimation]; on line 53 and add in [self.progressView setProgress:0.7 animated:YES];.

    Run the app and notice the flicker when the animation completes. Merge this branch and confirm the flicker is fixed.

    opened by scalessec 2
  • CocoaPod Issue?

    CocoaPod Issue?

    When I use cocoa pods:

    pod 'DACircularProgress', '2.1.0'

    I get a header that seems to be missing a function (specifically the clockwiseProgress call). If i download off GIT doesn't seem to be an issue. Any suggestions?

    -- the CocoaPod header is below --

    // // DACircularProgressView.h // DACircularProgress // // Created by Daniel Amitay on 2/6/12. // Copyright (c) 2012 Daniel Amitay. All rights reserved. //

    import <UIKit/UIKit.h>

    @interface DACircularProgressView : UIView

    @property(nonatomic, strong) UIColor *trackTintColor UI_APPEARANCE_SELECTOR; @property(nonatomic, strong) UIColor *progressTintColor UI_APPEARANCE_SELECTOR; @property(nonatomic) NSInteger roundedCorners UI_APPEARANCE_SELECTOR; // Can not use BOOL with UI_APPEARANCE_SELECTOR :-( @property(nonatomic) CGFloat thicknessRatio UI_APPEARANCE_SELECTOR; @property(nonatomic) CGFloat progress;

    @property(nonatomic) CGFloat indeterminateDuration UI_APPEARANCE_SELECTOR; @property(nonatomic) NSInteger indeterminate UI_APPEARANCE_SELECTOR; // Can not use BOOL with UI_APPEARANCE_SELECTOR :-(

    • (void)setProgress:(CGFloat)progress animated:(BOOL)animated;

    @end

    opened by jeeftor 2
  • With strict compiler settings returning CAAnimation * from indeterminate property fails to compile.

    With strict compiler settings returning CAAnimation * from indeterminate property fails to compile.

    The existing code fails with strict compiler settings. Return 0 if not indeterminate, 1 if it is.

    DACircularProgressView.m:216:12: error: incompatible pointer to integer conversion returning 'CAAnimation *__strong' from a function with result type 'NSInteger' (aka 'int'); [-Werror] return spinAnimation;

    opened by timle8n1 2
  • Please add semantic version tags

    Please add semantic version tags

    I’ve recently added DACircularProgress to the CocoaPods package manager repo.

    CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

    However, DACircularProgress doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

    Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

    In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

    $ git tag -a 1.0.0 -m "Tag release 1.0.0"
    $ git push --tags
    
    opened by fabiopelosin 2
  • Could make it look like ProgressHUD

    Could make it look like ProgressHUD

    Could make it easier to user like ProgressHUD. Show it can show default in center then users can not touch any areas else.... And easy to call the method like show and hide...

    opened by diegothucao 1
  • Custom timing function. Check animation

    Custom timing function. Check animation

    1. In my case animation should be like clock, so I needed linear animation. That is why custom timing function was added

    2. Animation in delegate should be checked. As mentioned below code is broken: self.progressView.setProgress(1.0, animated: true) //....and when I call during animation progress self.progressView.setProgress(0.5, animated: false) last call initiates remove of animation. And it calls animationDidStop delegate method asynchronously, even after proper progress is set. So after 0.5 is set, 1.0 will be in a moment

    opened by Igor-Palaguta 1
  • How to solve memory leak of this issue?

    How to solve memory leak of this issue?

    I have receive memory leak after set thicknessRatio value

    _progressView.thicknessRatio = 0.1; <--- this line

    and it show memory leak as this function

    • (DACircularProgressLayer *)circularProgressLayer { return (DACircularProgressLayer *)self.layer; }

    Please Help... Thank you

    opened by Cmdrobot 1
  • Set target value dynamically

    Set target value dynamically

    Hi, First of all thank you for the repository, we have used it in our application and its working good. We are struggling to set maximum value to it dynamically(Default one is 1.0f). And also we have used labelled circular so there its just UI issue the label is some what bigger in size so its overlapping with circle. Thanks. Appreciate feedback on this.

    opened by pragatphuke 0
  • let DACircularProgressView conform the protocol CAAnimationDelegate.

    let DACircularProgressView conform the protocol CAAnimationDelegate.

    let DACircularProgressView become the CABasicAnimation delegate,· must conform the protocol CAAnimationDelegate.· If not , there was a warning in project.

    opened by Little-Captain 0
  • Allow option to set animation removedOnCompletion to prevent animation stopping when navigating away.

    Allow option to set animation removedOnCompletion to prevent animation stopping when navigating away.

    Current animation implementation will stop if the view is removed from the super view. When the parent view is then re-added, the animation will not be playing.

    How should this be implemented? I will be glad to send a pull request.

    opened by ftvs 0
Owner
Daniel Amitay
Ones and zeros. Mostly zeros.
Daniel Amitay
Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView.

StepProgressView Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView. Usage let progr

Yonat Sharon 340 Dec 16, 2022
A swift PropertyWrapper to provide automatic NSView/UIView invalidation when the properties value changes.

A swift PropertyWrapper to provide automatic NSView/UIView invalidation when the properties value changes. It duplicates the @Invalidating propertyWrapper for build targets prior to macOS 12 and iOS 15.

Darren Ford 8 Oct 15, 2021
KYWheelTabController is a subclass of UITabBarController.It displays the circular menu instead of UITabBar.

KYWheelTabController KYWheelTabController is a subclass of UITabBarController.It displays the circular menu instead of UITabBar. Installation CocoaPod

kyo__hei 121 Oct 10, 2022
📊 A customizable gradient progress bar (UIProgressView).

GradientProgressBar A customizable gradient progress bar (UIProgressView). Inspired by iOS 7 Progress Bar from Codepen. Example To run the example pro

Felix M. 490 Dec 16, 2022
Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView.

StepProgressView Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView. Usage let progr

Yonat Sharon 340 Dec 16, 2022
UIProgressView replacement with an highly and fully customizable animated progress bar in pure Core Graphics

The YLProgressBar is an UIProgressView replacement with a highly and fully customizable animated progress bar in pure Core Graphics. It has been imple

Yannick Loriot 1.3k Jan 5, 2023
📊 A customizable gradient progress bar (UIProgressView).

GradientProgressBar A customizable gradient progress bar (UIProgressView). Inspired by iOS 7 Progress Bar from Codepen. Example To run the example pro

Felix M. 490 Dec 16, 2022
Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView.

StepProgressView Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView. Usage let progr

Yonat Sharon 340 Dec 16, 2022
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.

RichEditorView RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. Written in Swift 4 Supports iOS 8+ through Cocoapod

Caesar Wirth 1.8k Dec 24, 2022
UIView subclass that bends its edges when its position changes.

AHKBendableView BendableView is a UIView subclass that bends its edges when its position change is animated. Internally, BendableView contains CAShape

Arek Holko 591 Jul 24, 2022
DynamicBlurView is a dynamic and high performance UIView subclass for Blur.

DynamicBlurView DynamicBlurView is a dynamic and high performance UIView subclass for Blur. Appetize's Demo Since using the CADisplayLink, it is a hig

Kyohei Ito 929 Jan 5, 2023
FancyGradient is a UIView subclass which let's you animate gradients in your iOS app. It is purely written in Swift.

FancyGradient is a UIView subclass which let's you animate gradients in your iOS app. It is purely written in Swift. Quickstart Static gradient let fa

Derek Jones 11 Aug 25, 2022
UIView+CameraBackground - Show camera layer as a background to any UIView.

UIView+CameraBackground Show camera layer as a background to any UIView. Features Both front and back camera supported. Flash modes: auto, on, off. Co

Yonat Sharon 63 Nov 15, 2022
TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage

TextDrawer TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage. About Annotating Images TextDrawer is the easiest way

Remi ROBERT 106 Dec 18, 2022
Custom UIView class that hosts an array of UIbuttons that have an 'underline' UIView beneath them which moves from button to button when the user presses on them.

Swift-Underlined-Button-Bar Custom UIView class that hosts an array of UIbuttons that have an 'underline' UIView beneath them which moves from button

Justin Cook 3 Aug 4, 2022
Helps you define secure storages for your properties using Swift property wrappers.

?? Secure Property Storage Helps you define secure storages for your properties using Swift property wrappers. ?? Features All keys are hashed using S

Alex Rupérez 443 Jan 4, 2023
SwiftCheck is a testing library that automatically generates random data for testing of program properties

SwiftCheck QuickCheck for Swift. For those already familiar with the Haskell library, check out the source. For everybody else, see the Tutorial Playg

TypeLift 1.4k Dec 21, 2022
ValidatedPropertyKit enables you to easily validate your properties

ValidatedPropertyKit enables you to easily validate your properties with the power of Property Wrappers.

Sven Tiigi 887 Jan 5, 2023
Powerful property wrapper to back codable properties.

BackedCodable Powerful property wrapper to back codable properties. Why Swift's Codable is a great language feature but easily becomes verbose and req

Jérôme Alves 472 Dec 18, 2022
Trying to implement Unit Tests for @Binding properties in a ViewModel

BindingTester Trying to implement Unit Tests for @Binding properties in a ViewModel ViewModel to be tested class SheetViewModel: ObservableObject {

Raphael Guye 0 Oct 22, 2021