MarsFM
7/22/2018 - 6:24 PM

Delay in asyncAfter

fileprivate func delay(_ delay: Int, closure: @escaping () -> ()) {
    DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(delay)) {
      closure()
    }
}