Skip to content
This repository was archived by the owner on Aug 25, 2020. It is now read-only.

Question: Start Progress #16

Closed
tdouglas1313 opened this issue Sep 29, 2016 · 4 comments
Closed

Question: Start Progress #16

tdouglas1313 opened this issue Sep 29, 2016 · 4 comments

Comments

@tdouglas1313
Copy link

Is there currently an easy way to start the progress animation from lets say .3 to the updated progress?

I am able to get this functionality from changing the current progress in updateProgress to something other than 0 but I figured that I would ask to see if there is better way to do this

@tdouglas1313
Copy link
Author

I forked and created my own branch here:
https://github.com/tdouglas1313/RPCircularProgress/tree/startProgress

I would appreciate your opinion to know if what I have here is good and if you would like I can make a pull request.

@iwasrobbed
Copy link
Owner

Sorry for the extreme delay in response. updateProgress is meant to be used for this (you can see this in the chart example where it's done w/o animation)

@stoosepp
Copy link

I'm having the same question. I'm using your progress pie chart as a countdown timer for test questions. In the completion block, after the animation is complete, I run updateProgress(0.0) and the progressLayer.progress is still listed as 1.0, so there's no way to animate again for the next question. Ideas?

@iwasrobbed
Copy link
Owner

@stoosepp Could you post a Playground to repro your issue? It shouldn't matter when updateProgress gets called

Here's a quick example where I modified the example app bundled w/ this repo:

func setupThinProgress() {
    constrain(thinProgress, topView: thinIndeterminate)

    thinProgress.updateProgress(0.4, duration: 5)
    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(8 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)) {
        self.thinProgress.updateProgress(1, completion: {
            self.thinProgress.updateProgress(0.4, duration: 5)
        })
    }
}

example

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants