awakeAfter(using:)
Overridden by subclasses to substitute another object in place of the object that was decoded and subsequently received this message.
Declaration
func awakeAfter(using coder: NSCoder) -> Any?Parameters
- coder:
The decoder used to decode the receiver.
Return Value
The receiver, or another object to take the place of the object that was decoded and subsequently received this message.
Discussion
You can use this method to eliminate redundant objects created by the coder. For example, if after decoding an object you discover that an equivalent object already exists, you can return the existing object. If a replacement is returned, your overriding method is responsible for releasing the receiver.
This method is invoked by NSCoder. NSObject’s implementation simply returns self.