Instance Method

decodeTopLevelObject()

Decodes a previously-encoded object.

Declaration

@nonobjc func decodeTopLevelObject() throws -> Any?

Return Value

The decoded object, or nil if decoding fails.

See Also

Decoding Top-Level Objects

func decodeObject<DecodedObjectType>(of: DecodedObjectType.Type, forKey: String) -> DecodedObjectType?

Decode an object as an expected type, failing if the archived type doesn’t match.

func decodeObject(of: [AnyClass]?, forKey: String) -> Any?

Decode an object as one of several expected types, failing if the archived type doesn’t match any of the types.

func decodeTopLevelObject(forKey: String) -> Any?

Decodes the previously-encoded object associated by a key.

func decodeTopLevelObject<DecodedObjectType>(of: DecodedObjectType.Type, forKey: String) -> DecodedObjectType?

Decode an object as one of several expected types, failing if the archived type does not match.

func decodeTopLevelObject(of: [AnyClass]?, forKey: String) -> Any?

Decode an object as one of several expected types, failing if the archived type does not match.