This PR adds a new associated type to Attachable that can be used to supply additional metadata to an attachment that is specific to that type. Metadata is always optional and the default type is Never (i.e. by default there is no metadata.)
The Encodable and NSSecureCoding conformances in the Foundation cross-import overlay have been updated such that this type equals a new structure that describes the format to use as well as options to pass to the JSON encoder (if one is used) and user info to pass to the plist or JSON encoders (if used.) We must use this type even for types that conform only to NSSecureCoding, otherwise we get compile-time errors about the type being ambiguous if a type conforms to both protocols and to Attachable.
Checklist:
[x] Code and documentation should follow the style of the Style Guide.
[x] If public symbols are renamed or modified, DocC references should be updated.
This PR adds a new associated type to
Attachable
that can be used to supply additional metadata to an attachment that is specific to that type. Metadata is always optional and the default type isNever
(i.e. by default there is no metadata.)The
Encodable
andNSSecureCoding
conformances in the Foundation cross-import overlay have been updated such that this type equals a new structure that describes the format to use as well as options to pass to the JSON encoder (if one is used) and user info to pass to the plist or JSON encoders (if used.) We must use this type even for types that conform only toNSSecureCoding
, otherwise we get compile-time errors about the type being ambiguous if a type conforms to both protocols and toAttachable
.Checklist: