Class

MLTask

An abstract base class for machine learning tasks.

Declaration

class MLTask : NSObject

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

var taskIdentifier: String

A unique name of the task to distinguish it from all other tasks at runtime.

Starting and Stopping a Task

func resume()

Begins or resumes a machine learning task.

func cancel()

Cancels a machine learning task before it completes.

Checking the State of a Task

var state: MLTaskState

The current state of the machine learning task.

enum MLTaskState

The state of a machine learning task.

var error: Error?

The underlying error if the task is in a failed state.

Relationships

Inherits From

Conforms To

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software