bsm-project/Friendvatars/DispatchQueue+Delay.swift

13 lines
230 B
Swift
Raw Normal View History

2018-11-19 14:31:37 +01:00
import Foundation
extension DispatchQueue {
class func delay(_ delay: Double, closure: @escaping ()->()) {
DispatchQueue.main.asyncAfter(
deadline: DispatchTime.now() + delay,
execute: closure
)
}
}