var dispatchAfter = DispatchTimeInterval.seconds(1) DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + dispatchAfter, execute: { // Do your thing })