danielamitay / dacircularprogress Goto Github PK
View Code? Open in Web Editor NEWDACircularProgress is a UIView subclass with circular UIProgressView properties.
License: Other
DACircularProgress is a UIView subclass with circular UIProgressView properties.
License: Other
I have receive memory leak after set thicknessRatio value
_progressView.thicknessRatio = 0.1; <--- this line
and it show memory leak as this function
Please Help... Thank you
I'm sorry to tell you, but your library doesn't build in iOS 10 anymore.
Here is the Fix:
DACircularProgressView.h line 11
replace:
@interface DACircularProgressView : UIView
with:
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_10_0
@interface DACircularProgressView : UIView
#else
@interface DACircularProgressView : UIView <CAAnimationDelegate>
#endif
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?
Hello us! I need to animate the values from 3 to 7, for example. How can this be done?
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.
//
@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 :-(
Please modify README to indicate this control is not compatible with iOS 4
On setting progress to 0.f using set progress the circular progress animates to 0 then seems to flash the previous value
I want to change the start and end position of the circular progress view. How can I do that? Thanks
When you install it via pod you can't use the labeled progress view.
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.
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.
-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.
if you set de thicknessRatio under 0.3, as set in initialize method:
(void) initialize
{
if (self == [DACircularProgressView class]) {
DACircularProgressView *circularProgressViewAppearance = [DACircularProgressView appearance];
[circularProgressViewAppearance setTrackTintColor:[[UIColor whiteColor] colorWithAlphaComponent:0.3f]];
[circularProgressViewAppearance setProgressTintColor:[UIColor whiteColor]];
[circularProgressViewAppearance setInnerTintColor:nil];
[circularProgressViewAppearance setBackgroundColor:[UIColor clearColor]];
[circularProgressViewAppearance setThicknessRatio:0.3f];
[circularProgressViewAppearance setRoundedCorners:NO];
[circularProgressViewAppearance setClockwiseProgress:YES];
[circularProgressViewAppearance setIndeterminateDuration:2.0f];
[circularProgressViewAppearance setIndeterminate:NO];
}
}
The thicknessRatio never changes its value.
¿Does anybody know why?
Thanks.
Here is my code. Is it because of the decimal value?
progressBlock: { (progress: Int32) -> Void in
if progress <= 99 {
self.progressView.setProgress(CGFloat(progress)/100, animated: true)
print("CG value: \(CGFloat(progress)/100)")
print(self.progressView.progress)
} else {
self.progressView.removeFromSuperview()
}
}
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.
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
I have a self-defined view. And it has a DACircularProgressView as subview.
@interface TestView : UIView
{
DACircularProgressView *_progressView;
}
@property(nonatomic, strong)DACircularProgressView *progressView;
And I want this TestView loaded from xib files. So my implementation file as below:
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self _myInitialize];
}
return self;
}
- (void)awakeFromNib
{
[self _myInitialize];
}
- (void)_myInitialize
{
_progressView = [[DACircularProgressView alloc] initWithFrame:self.bounds];
_progressView.trackTintColor = [UIColor grayColor];
_progressView.progressTintColor = [UIColor greenColor];
[self addSubview:_progressView];
}
When add my TestView to my view controller's xib file, I can't see the right progress view. While when I alloc my TestView in viewDidLoad
method, and add it to my self.view
, I can see the right progress view. I want know why? Is there any mistake I have made? Thanks advance.
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...
The -setIndeterminate: method has a logic error. It should be:
if (indeterminate) {
if (!self.indeterminate) {
CABasicAnimation *spinAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
spinAnimation.byValue = [NSNumber numberWithDouble:indeterminate > 0 ? 2.0f*M_PI : -2.0f*M_PI];
spinAnimation.duration = self.indeterminateDuration;
spinAnimation.repeatCount = HUGE_VALF;
[self.layer addAnimation:spinAnimation forKey:@"indeterminateAnimation"];
}
} else {
[self.layer removeAnimationForKey:@"indeterminateAnimation"];
}
With the existing implementation, if indeterminate
is YES, setting the property to YES again has the effect of removing the animation because indeterminate && !self.indetermine
evaluates to NO.
(Sorry this isn't coming as a pull request with the fix... really pressed for time at the moment.)
I am putting this out here to test the waters: What do you think about adding an indeterminate
property to DACircularProgress
?
The idea is that while indeterminate, the circular progress view itself will rotate (progress
property is still utilized). The most common example is the tab loading indicator in Chrome. Adding this property to DACircularProgress
would make such an implementation trivial.
I am fond of this style because it immediately indicates to the user that work is being done, but handles scenarios where there is no loading progress for a non-negligible amount of time.
Example with both progress
being incremented, and indeterminate
true:
Any thoughts?
Sld
I would like to use this as a clock timer..so the progress must complete its loop every 60 ticks instead of a hundred.. How do I do that ?
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
I want to stop animation after setProgress method call in some position.
Is it possible to make? And how I can achieve this.
Thanks.
First in swift you have to do something like this:
progressView.indeterminate = 1
When I set that, the progressView stays empty and does nothing.
The value of the indeterminate
property is based on the presence of the spin animation on the view's layer. This causes an issue when attempting to set the indeterminate
property to YES when the view doesn't belong to a window because the animation is not preserved when the view is moved to a window; iOS seems to remove all animations when a view is added to a window.
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.
hi,your library is awesome.I need to set maximum value and minimum value.
I am trying this code for setting 2mins as maximum value.
-(void)progressChange{
//CGFloat progress = self.largeProgressView.progress+(totalOne/100)+0.011;
CGFloat progress = self.largeProgressView.progress+(totalOne/1000)+0.0083;
NSLog(@"totttal------>%d",totalOne);
if (totalOne>0) {
n=n+1;
totalOne--;
[self.largeProgressView setProgress:progress animated:YES];
}else{
[self.timer invalidate];
self.largeProgressView.progress=0;
NSLog(@"%d",n);
NSLog(@"completed");
}
}
where total one is 120 secs.
My value is static so i going with this and working fine..
If i have any other value i need to change this.is there any property for setting maximum value?
Hello
"[appearance setIndeterminate:NO];" in mehtod initialize.
its a error - "Multiple method named 'setIndeterminate' found with mismatched..." if I have a property named indeterminate in my class or third parties class.
solution:
use "[[DACircularProgressView appearance] setIndeterminate:NO];" instead of "[appearance setIndeterminate:NO];" in method initialize
PS:
The code in initialize method seems to have no effect.When the initialize method is called, any instance hasn't been created
Animation jumps if animation is not completed yet and we set new progress value.
Even incorrect value can be set, like in mentioned above example:
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 set in animationDidStop in a moment
Version 2.2 without animation delegate works fine
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.