bsm-project/Friendvatars/DispatchQueue+Delay.swift

14 lines
231 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
)
}
}