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