---
title: MLTask
framework: coreml
role: symbol
role_heading: Class
path: coreml/mltask
---

# MLTask

An abstract base class for machine learning tasks.

## Declaration

```swift
class MLTask
```

## Overview

Overview You don’t create use this class directly. Instead, use a class that inherits from this one, such as MLUpdateTask.

## Topics

### Identifying a task

- [taskIdentifier](coreml/mltask/taskidentifier.md)

### Starting and stopping a task

- [resume()](coreml/mltask/resume().md)
- [cancel()](coreml/mltask/cancel().md)

### Checking the state of a task

- [state](coreml/mltask/state.md)
- [MLTaskState](coreml/mltaskstate.md)
- [error](coreml/mltask/error.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [MLUpdateTask](coreml/mlupdatetask.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### On-device model updates

- [Personalizing a Model with On-Device Updates](coreml/personalizing-a-model-with-on-device-updates.md)
- [MLUpdateTask](coreml/mlupdatetask.md)
