What exactly is going on with DispatchTime.now()
DispatchTime.now()
How come I can\'t assign the time to wait as a variable?
And How Could I use a variable ?
You can use DispatchTimeInterval to add time in DispatchTime.
DispatchTimeInterval
DispatchTime
For Example :
let whenWhen = DispatchTime.now() + DispatchTimeInterval.seconds(time) DispatchQueue.main.asyncAfter(deadline: whenWhen){ print("Hello") }