-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
Nice project!
I am integrating UAProgressView in my project written in swift. I tried to update the value of the current progress as follows:
override func awakeFromNib() {
super.awakeFromNib()
self.progressView.borderWidth = 2.0
self.progressView.lineWidth = 8.0
self.progressView.fillOnTouch = false
self.progressView.animationDuration = 2.0
self.textLabel = UILabel(frame: CGRectMake(0, 0, 60.0, 32.0))
self.textLabel.font = UIFont(name: "HelveticaNeue-UltraLight", size: 22)
self.textLabel.textAlignment = NSTextAlignment.Center
self.textLabel.textColor = self.progressView.tintColor
self.textLabel.backgroundColor = UIColor.clearColor()
self.progressView.centralView = self.textLabel
self.progressView.progressChangedBlock = { (progressView:UAProgressView!, progress:Float) -> () in
let lableview = progressView.centralView as! UILabel
lableview.text = StringManager.float2str(progress*100)
println("Current progress")
println(progress)
}
}
But the block is invoked only once as in the main code:
self.scoreshareview.setViewProgress(StringManager.str2float(score))
function setViewProgress:
func setViewProgress(score:Float){
self.progressView.setProgress(score/100, animated: true)
}
I am new to iOS and not sure where the problem is.
Thanks for sharing!
Metadata
Metadata
Assignees
Labels
No labels