So I'm trying to make a function refresh every 1 second so it updates a label, unfortunately it's not trigger for some reason. Code below with comments.
import UIKit
class ViewController: UIViewController {
@IBOutlet var tt_CountDown: UILabel!
var tt_currentDate = NSDate()
var tt_objCalendar = NSCalendar.currentCalendar()
override func viewDidLoad() {
super.viewDidLoad()
self.timeClassManagement()
//The timer I'm using to call the function to repeat
var timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("timeClassManagement"), userInfo: nil, repeats: true)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func timeClassManagement(){
//the function that holds the code for the label below
tt_CountDown.text = "\(String(tt_hour)):\(String(tt_minute)):\(String(tt_second))"
}
}