I have a while loop thats going too fast so I want to make it happen every second or so. I have this right now:
while (i == 1, ) {
println("printed")
}
I have a while loop thats going too fast so I want to make it happen every second or so. I have this right now:
while (i == 1, ) {
println("printed")
}
You can use NSTimer
and schedule an action each second:
NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: "yourMethodToCall", userInfo: nil, repeats: true)
func yourMethodToCall(){
println("each second")
}