Open
Description
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.