Instance Method

encode(_:forKey:)

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

Declaration

func encode(_ point: CGPoint, forKey key: String)

Parameters

point

The point 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 decodeCGPoint(forKey:) method to retrieve the data.

See Also

Encoding Geometry-Based Data

func encode(CGAffineTransform, forKey: String)

Encodes an affine transform and associates it with the specified key in the receiver’s archive.

func encode(CGRect, forKey: String)

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

func encode(CGSize, forKey: String)

Encodes size information and associates it with the specified key in the coder’s archive.

func encode(CGVector, forKey: String)

Encodes vector data and associates it with the specified key in the coder’s archive.

func encode(NSDirectionalEdgeInsets, forKey: String)

Encodes directional edge inset data and associates it with the specified key in the coder’s archive.

func encode(UIEdgeInsets, forKey: String)

Encodes edge inset data and associates it with the specified key in the coder’s archive.

func encode(UIOffset, forKey: String)

Encodes offset data and associates it with the specified key in the coder’s archive.