Skip to content

Progress does not follow interval #85

Open

Description

@daweedm

Hello,

I have a problem with the "image progress"

I want the progress to follow the speed of the interval. I update also an UILabel, that updates at good speed according to the interval, but the image progress doesn't : it simply animate at fixed speed after a short delay ...

Here is my code :

override func viewWillAppear(animated: Bool) {
              updateTimer = NSTimer.scheduledTimerWithTimeInterval(0.01, target: self, selector: "upProgress", userInfo: nil, repeats: true)
              super.viewWillAppear(animated)

    }
func upProgress() {
        dispatch_async(dispatch_get_main_queue(), {
            self.iconProgress.setProgress(CGFloat(++self.counterProgress) / CGFloat(100), animated: true)
            self.progressLabel.text = String(self.counterProgress) + "%"
            if(self.counterProgress == 100) {
                self.updateTimer.invalidate()
            }
        })
    }

Can anyone help me to fix this ?

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions