DelayTask
public class DelayTask
Cancelable delayed task
-
Whether this task is canceled.
Declaration
Swift
public var isCanceled: Bool
-
Whether this task has been executed.
Declaration
Swift
public private(set) var isExecuted: Bool
-
Queue the task will run
Declaration
Swift
public let queue: DispatchQueue
-
Start the task.
Declaration
Swift
public func start()
-
Chaining a new task.
Declaration
Swift
@discardableResult public func delay(_ delayedSeconds: TimeInterval, queue: DispatchQueue = .global(), task: @escaping () -> Void) -> DelayTask
Parameters
delayedSeconds
The delayed seconds.
queue
The dispatch queue to run on.
task
The closure to run.