delay executes code in swift

PHOTO EMBED

Tue Jun 21 2022 09:57:38 GMT+0000 (Coordinated Universal Time)

Saved by @InterChains #swift

let timer = 1

DispatchQueue.main.asyncAfter(deadline: .now() + timer) {
    // code to execute after 1 second
}
content_copyCOPY

put this inside a function and then the code should execute and specify what to happen after that