checkCancellation

Throws an error if the task was canceled.

iOS
13.0+
macOS
10.15+
tvOS
13.0+
watchOS
6.0+
static func checkCancellation() throws

The error is always an instance of CancellationError.