forked from I2P_Developers/i2p.i2p
Mac OSX Launcher: Delay extension for the DispatchQueue Cocoa/OSX class.
This commit is contained in:
15
launchers/macosx/CommonCode/Utils/DispatchQueue+delay.swift
Normal file
15
launchers/macosx/CommonCode/Utils/DispatchQueue+delay.swift
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// DispatchQueue+delay.swift
|
||||
// I2PLauncher
|
||||
//
|
||||
// Created by Mikal Villa on 24/04/2019.
|
||||
// Copyright © 2019 The I2P Project. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension DispatchQueue {
|
||||
static func delay(_ delay: DispatchTimeInterval, closure: @escaping () -> ()) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: closure)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user