Comments (5)
Hi @zulkarnain-shah,
There is no such callback. If you look closely to standard iOS ProgressView: https://developer.apple.com/documentation/uikit/uiprogressview, it doesn't have it either.
The idea is to have this control only to present things, and because you are in full control of what it is presenting - you can wait for time it ends animation and then execute your specific instructions.
Thanks,
from circleprogressbar.
I actually found a solution to that. In the callback handler of the method circleProgressBar.setHintTextGenerationBlock, I check when the progress == 1.0 then i do stuff that I need to do. A progress value of 1.0 means that animation has completed! Voila !
from circleprogressbar.
Hehe, Well, if that's what you prefer ^_^
Usually I would separate presentation logic from business logic, because this is just a visual control, and it should not block other application logic.
from circleprogressbar.
It does the job for me. And its the correct calculation of the progress as well, isn't it ?
from circleprogressbar.
@zulkarnain-shah
Yeah, that's true.
Don't get me wrong, it's just the source of this data. For example in this case, this updates comes like this:
progress set outside -> internal timer -> animation -> callback
And if timer or animation step in this chain would change - you can get wrong results in the callback. So instead of relying on last part of this chain, you can define everything outside (in your controller).
for example:
[_progressBar setProgress:0.5f animated:YES duration:0.5f];
// you timer that will fire after 0.5f (when animation should complete already)
// but it will be more reliable that UI element that just used to display things
To follow Single Responsibility Principle.
from circleprogressbar.
Related Issues (16)
- IB_DESIGNABLE for CircleProgressBar Not Working HOT 1
- Set line cap HOT 3
- Anti-clock wise progress HOT 4
- Start angle defaults to 90 HOT 1
- Transparent hintViewBackgroundColor HOT 3
- How to create two lines Inside the circle Progress Bar? HOT 1
- Action (User Input) HOT 1
- Add setHintAttributedStringGenerationBlock method HOT 8
- Progress Duration is Wrong HOT 6
- Error with hint text generation block example HOT 2
- How do we do the track tickness
- Background is black no matter what HOT 3
- Custom progress change animation time
- Duration HOT 6
- CircleProgressBar doesn't update progress value when animated change method is called very often HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circleprogressbar.