Class
BaseOperation
open class BaseOperation<Success>: Operation
An operation that simplifies state flag handling and provides a method to finish a task delivering a result
containing either a Success
response or an Error
response.
State behavior:
-
The operation, regardless of state, will always return
isReady
true. -
An executing operation will return
isExecuting
true. -
A finished operation will return
isFinished
true. -
A cancelled operation will return
isCancelled
true.
Relationships
Conforms To
Operation
Nested Type Aliases
Properties
isReady
open override var isReady: Bool
isExecuting
open override var isExecuting: Bool
isFinished
open override var isFinished: Bool
Methods
start()
open override func start()
cancel()
open override func cancel()
finish(with:)
open func finish(with result: Result)