I have a coding \'issue\'.
I have a label, which text I want to change dynamically every 2 seconds. I\'ve done the following:
// WELCOME STRING ARRA
You can also use this function to delay something
//MARK: Delay func
func delay(_ delay:Double, closure:@escaping ()->()) {
DispatchQueue.main.asyncAfter(
deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure)
}
and usage is :
delay(2) //Here you put time you want to delay
{
//your delayed code
}
Hope it will help you.