Contents

setVersion(_:)

Sets the receiver’s version number.

Declaration

class func setVersion(_ aVersion: Int)

Parameters

  • aVersion:

    The version number for the receiver.

Discussion

The version number is helpful when instances of the class are to be archived and reused later. The default version is 0.

Special Considerations

The version number applies to NSArchiver/NSUnarchiver, but not to NSKeyedArchiver/NSKeyedUnarchiver. A keyed archiver does not encode class version numbers.

See Also

Archiving