Giter Site home page Giter Site logo

Comments (5)

Eclair avatar Eclair commented on August 23, 2024

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.

zulkarnain-shah avatar zulkarnain-shah commented on August 23, 2024

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.

Eclair avatar Eclair commented on August 23, 2024

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.

zulkarnain-shah avatar zulkarnain-shah commented on August 23, 2024

It does the job for me. And its the correct calculation of the progress as well, isn't it ?

from circleprogressbar.

Eclair avatar Eclair commented on August 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.