main.swift99 chars4 lines
The DispatchQueue.main.asyncAfter()
method can be used to schedule a block of code to execute after a certain delay. The deadline
parameter is a DispatchTime
value representing the time at which the block should run, calculated as now plus the desired delay (TimeInterval
). In this case, the code block will be executed on the main thread after a delay of 5 seconds.
gistlibby LogSnag