A type that can be converted to and from a value in a data table.


A data table may contain an instance of any type that can be represented as an MLDataValue. The Array and Dictionary structures already conform to the MLDataValueConvertible protocol, but you can adopt this protocol in your own code as well.

When you create a data table from a dictionary of columns, you can use any data value-convertible type. The init(dictionary:) initializer in MLDataTable automatically converts the column values you provide into data values.


Converting a Data Value to an Instance of a Type


Creates a new default value representing a missing or invalid value.


init?(from: MLDataValue)

Creates an instance of the conforming type from a data value.


Converting an Instance of a Type to a Data Value

var dataValue: MLDataValue

A data value representation of an instance of the conforming type.


static var dataValueType: MLDataValue.ValueType

The kind of data value to which the conforming type may be converted.



Adopted By

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