A Boolean value indicating whether the operation has been cancelled
- iOS 2.0+
- macOS 10.5+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The default value of this property is
false. Calling the
cancel() method of this object sets the value of this property to
true. Once canceled, an operation must move to the finished state.
Canceling an operation does not actively stop the receiver’s code from executing. An operation object is responsible for calling this method periodically and stopping itself if the method returns
You should always check the value of this property before doing any work towards accomplishing the operation’s task, which typically means checking it at the beginning of your custom
main() method. It is possible for an operation to be cancelled before it begins executing or at any time while it is executing. Therefore, checking the value at the beginning of your
main() method (and periodically throughout that method) lets you exit as quickly as possible when an operation is cancelled.