One Logo Pool Ball
Foundation · IOS API REFERENCE

PropertyListDecoder

class · iOS 8.0+ · SDK 27.1

class PropertyListDecoder

An object that decodes instances of data types from a property list.

Members (5)

method · iOS 8.0+

decode

TypeScript
decodeFromFormat(type: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String" | "CGFloat" | "Date" | "URL" | "Data" | "UUID", data: ArrayBuffer, format: PropertyListSerialization_PropertyListFormat): { $ret: unknown; $out: { "format": PropertyListSerialization_PropertyListFormat } }
Swift declaration
func decode<T>(_ type: T.Type, from data: Data, format: inout PropertyListDecoder.PropertyListFormat) throws -> T where T : Decodable

Returns a value of the specified type by decoding a property list using the supplied format. - parameter type: The type of the value to decode. - parameter data: The data to decode from. - parameter format: The parsed property list format. - returns: A value of the requested type along with the detected format of the property list. - throws: `DecodingError.dataCorrupted` if values requested from the payload are corrupted, or if the given data is not a valid property list. - throws: An error if any value throws an error during decoding.

Omit the output parameters from the call. The result contains $ret and $out, with format inside $out.

method · iOS 8.0+

decode

TypeScript
decodeFrom(type: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String" | "CGFloat" | "Date" | "URL" | "Data" | "UUID", data: ArrayBuffer): unknown
Swift declaration
func decode<T>(_ type: T.Type, from data: Data) throws -> T where T : Decodable

Returns a value of the specified type by decoding a property list using the default property list format. - parameter type: The type of the value to decode. - parameter data: The data to decode from. - returns: A value of the requested type. - throws: `DecodingError.dataCorrupted` if values requested from the payload are corrupted, or if the given data is not a valid property list. - throws: An error if any value throws an error during decoding.

get · iOS 8.0+

userInfo

TypeScript
get userInfo(): NativeMap<SDKHandle, SDKHandle>
Swift declaration
@preconcurrency var userInfo: [CodingUserInfoKey : any Sendable] { get set }

A dictionary you use to customize decoding by providing contextual information.

set · iOS 8.0+

userInfo

TypeScript
set userInfo(value: NativeMap<SDKHandle, SDKHandle>)
Swift declaration
@preconcurrency var userInfo: [CodingUserInfoKey : any Sendable] { get set }

A dictionary you use to customize decoding by providing contextual information.

init · iOS 8.0+

init

TypeScript
static init(): PropertyListDecoder
Swift declaration
init()

Creates a new, reusable property list decoder.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

PropertyListDecoder.decode(_:from:configuration:)

This declaration needs Swift generic type arguments. (no canonical witness for T.DecodingConfiguration)

PropertyListDecoder.decode(_:from:configuration:)

Passing a Swift type itself is not supported.

PropertyListDecoder.decode(_:from:format:configuration:)

Passing a Swift type itself is not supported.

PropertyListDecoder.decode(_:from:format:configuration:)

This declaration needs Swift generic type arguments. (no canonical witness for T.DecodingConfiguration)

All Foundation types →