Contents

encode(_:forKey:)

Encodes a rectangle and associates it with the specified key in the receiver’s archive.

Declaration

func encode(_ rect: CGRect, forKey key: String)

Parameters

  • rect:

    The rectangle to encode.

  • key:

    The key identifying the data.

Discussion

When decoding the data from the archive, you pass the value in the key parameter to the corresponding decodeCGRect(forKey:) method to retrieve the data.

See Also

Related Documentation

Encoding Geometry-Based Data