diff --git a/PSOperations/Operation.swift b/PSOperations/Operation.swift index deaa33b..a58d974 100644 --- a/PSOperations/Operation.swift +++ b/PSOperations/Operation.swift @@ -18,12 +18,18 @@ public typealias PSOperation = Operation open class Operation: Foundation.Operation { private static var psoperationContext = 0 - + +#if swift(>=5.9) + public typealias CompletionBlock = @Sendable () -> Void +#else + public typealias CompletionBlock = () -> Void +#endif + /* The completionBlock property has unexpected behaviors such as executing twice and executing on unexpected threads. BlockObserver * executes in an expected manner. */ @available(*, deprecated, message: "use BlockObserver completions instead") - override open var completionBlock: (() -> Void)? { + override open var completionBlock: CompletionBlock? { get { return nil }