init(forReadingFrom:)
Initializes an archiver to decode data from the specified location.
Declaration
init(forReadingFrom data: Data) throwsParameters
- data:
An archive previously encoded by Nskeyedarchiver.
Discussion
This initializer enables requiresSecureCoding by default, and sets the decodingFailurePolicy to NSCoder.DecodingFailurePolicy.setErrorAndReturn.
Call finishDecoding() when you finish decoding data
This method throws an error if data isn’t a valid keyed archive.