Initializer

init(coder:)

Returns an object initialized from data in a given unarchiver.

Required.

Declaration

init?(coder: NSCoder)

Parameters

decoder

An unarchiver object.

Return Value

self, initialized using the data in decoder.

Discussion

You typically return self from init(coder:). If you have an advanced need that requires substituting a different object after decoding, you can do so in awakeAfter(using:).

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software