init(requiringSecureCoding:)
Creates an archiver to encode data, and optionally disables secure coding.
Declaration
init(requiringSecureCoding requiresSecureCoding: Bool)Parameters
- requiresSecureCoding:
A Boolean value indicating whether all encoded objects must conform to Nssecurecoding.
Discussion
To prevent the possibility of encoding an object that NSKeyedUnarchiver can’t decode, set requiresSecureCoding to true whenever possible. This ensures that all encoded objects conform to NSSecureCoding.