Commit f6076db 1 parent 8b284dc commit f6076db Copy full SHA for f6076db
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 9
9
import Foundation
10
10
11
11
extension Extendable where Base: DispatchQueue {
12
- public typealias Task = ( _ canceled: Bool ) -> Void
12
+ public typealias DispatchTask = ( _ canceled: Bool ) -> Void
13
13
14
14
/// Create a deferred task that can be canceled midway using the `cancel()` method.
15
15
///
@@ -21,15 +21,15 @@ extension Extendable where Base: DispatchQueue {
21
21
public static func after(
22
22
_ time: DispatchTimeInterval ,
23
23
execute task: @escaping EmptyClosure
24
- ) -> Task ? {
24
+ ) -> DispatchTask ? {
25
25
func _after( block: @escaping EmptyClosure ) {
26
26
DispatchQueue . main. asyncAfter ( deadline: . now( ) + time, execute: block)
27
27
}
28
28
29
29
var taskAction : EmptyClosure ? = task
30
- var result : Task ?
30
+ var result : DispatchTask ?
31
31
32
- let delayedClosure : Task = { canceled in
32
+ let delayedClosure : DispatchTask = { canceled in
33
33
if let action = taskAction, !canceled {
34
34
DispatchQueue . main. async ( execute: action)
35
35
}
@@ -47,7 +47,7 @@ extension Extendable where Base: DispatchQueue {
47
47
/// Cancel delayed tasks
48
48
///
49
49
/// - Parameter task: Task to be canceled
50
- public static func cancel( _ task: Task ? ) {
50
+ public static func cancel( _ task: DispatchTask ? ) {
51
51
task ? ( true )
52
52
}
53
53
}
You can’t perform that action at this time.
0 commit comments