mariia
6/25/2019 - 4:55 AM

Delay function call

//Version 1, with Dispatch queues.
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
  //code to delay
}


//Version 2, with selectors.
@objc func authenticate() {
    print("Authentication")
}

perform(#selector(authenticate), with: nil, afterDelay: 1)