AsynchronousOperation
open class AsynchronousOperation : Operation, ProgressReporting
An abstract thread safe subclass of Operation
to support asynchronous operations.
Subclasses must override main
to perform any work and, if they are asynchronous, call the finish()
method to complete the execution.
-
The
progress
property represents a total progress of the operation during its execution.Declaration
Swift
@objc public final lazy private(set) var progress: Progress { get set }
-
Undocumented
Declaration
Swift
open override var isReady: Bool { get }
-
Undocumented
Declaration
Swift
public final override var isExecuting: Bool { get }
-
Undocumented
Declaration
Swift
public final override var isFinished: Bool { get }
-
Undocumented
Declaration
Swift
public final override var isAsynchronous: Bool { get }
-
Undocumented
Declaration
Swift
public final override var isConcurrent: Bool { get }
-
Undocumented
Declaration
Swift
public final override func start()
-
The default implementation of this method does nothing. You should override this method to perform the desired task. In your implementation, do not invoke super. This method will automatically execute within an autorelease pool provided by Operation, so you do not need to create your own autorelease pool block in your implementation.
Note
Once the task is finished you must callfinish()
to complete the execution.Declaration
Swift
open override func main()
-
Finishes the operation.
Important
You should never call this method outside the operation main() execution scope.Declaration
Swift
public func finish()
-
Undocumented
Declaration
Swift
open override func cancel()
-
Undocumented
Declaration
Swift
open override var description: String { get }
-
Undocumented
Declaration
Swift
open override var debugDescription: String { get }