Skip to content

[SR-8065] Allow decoding from NSDictionarys/NSArrays with PropertyListDecoder #3671

Open
@swift-ci

Description

@swift-ci
Previous ID SR-8065
Radar None
Original Reporter jayrhynas (JIRA User)
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels New Feature, Codable
Assignee None
Priority Medium

md5: 1c710bc510dc460690e0063740984094

Issue Description:

Currently, PropertyListDecoder can only decode from instances of Data.
Internally, it calls PropertyListSerialization.propertyList(from: data, options: [], format: &format) on that data to get a top level object, then calls an internal function decode<T>(_ type: T.Type, fromTopLevel container: Any) to perform the actual decoding.

I think it would make sense to make that function public, as sometimes you already have a property list object that you want to decode into the correct swift classes. The only way to do that right now is to wastefully re-serialize it to Data first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions