<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLTaskState",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:@E@MLTaskState"
  },
  "title" : "MLTaskState"
}
-->

# MLTaskState

The state of a machine learning task.

```
enum MLTaskState
```

## Topics

### Transient states

[`MLTaskState.running`](/documentation/CoreML/MLTaskState/running)

The state of a machine learning task that’s executing.

[`MLTaskState.suspended`](/documentation/CoreML/MLTaskState/suspended)

The state of a machine learning task that’s paused.

[`MLTaskState.cancelling`](/documentation/CoreML/MLTaskState/cancelling)

The state of a machine learning task that’s in mid-termination, before it could finish successfully.

### Final states

[`MLTaskState.completed`](/documentation/CoreML/MLTaskState/completed)

The state of a machine learning task that has finished successfully.

[`MLTaskState.failed`](/documentation/CoreML/MLTaskState/failed)

The state of a machine learning task that has terminated due to an error.

### Creating a task state

[`init(rawValue:)`](/documentation/CoreML/MLTaskState/init(rawValue:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)