Hi I am using this code to try and animate a progress bar based on time.
import UIKit
class LoadingScreen: UIViewController {
@IBOutlet var progressView: UIProgressView!
override func viewDidLoad() {
super.viewDidLoad()
var time = 0.0
var timer: NSTimer
timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector:Selector("setProgress"), userInfo: nil, repeats: true)
func setProgress() {
time += 0.1
progressView.progress = time / 3
if time >= 3 {
timer.invalidate()
}
}
However I get an error which says: cannot sign a value of type double to a value of type float.
EDIT:
The error is on this line:
progressView.progress = time / 3