NSCoder UIKit Additions Reference

Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 2.0 and later.
Declared in
UIGeometry.h

Overview

This category adds methods to the Foundation framework’s NSCoder class. The methods in this category let you encode and decode geometry-based data used by the UIKit framework.

Tasks

Encoding Data

Decoding Data

Instance Methods

decodeCGAffineTransformForKey:

Decodes and returns the CGAffineTransform structure associated with the specified key in the receiver’s archive.

- (CGAffineTransform)decodeCGAffineTransformForKey:(NSString *)key
Parameters
key

The key that identifies the affine transform.

Return Value

The affine transform.

Discussion

Use this method to decode size information that was previously encoded using the encodeCGAffineTransform:forKey: method.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

decodeCGPointForKey:

Decodes and returns the CGPoint structure associated with the specified key in the receiver’s archive.

- (CGPoint)decodeCGPointForKey:(NSString *)key
Parameters
key

The key that identifies the point.

Return Value

The CGPoint structure.

Discussion

Use this method to decode a point that was previously encoded using the encodeCGPoint:forKey: method.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

decodeCGRectForKey:

Decodes and returns the CGRect structure associated with the specified key in the receiver’s archive.

- (CGRect)decodeCGRectForKey:(NSString *)key
Parameters
key

The key that identifies the rectangle.

Return Value

The CGRect structure.

Discussion

Use this method to decode a rectangle that was previously encoded using the encodeCGRect:forKey: method.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

decodeCGSizeForKey:

Decodes and returns the CGSize structure associated with the specified key in the receiver’s archive.

- (CGSize)decodeCGSizeForKey:(NSString *)key
Parameters
key

The key that identifies the size information.

Return Value

The CGSize structure.

Discussion

Use this method to decode size information that was previously encoded using the encodeCGSize:forKey: method.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

decodeUIEdgeInsetsForKey:

Decodes and returns the UIEdgeInsets structure associated with the specified key in the receiver’s archive.

- (UIEdgeInsets)decodeUIEdgeInsetsForKey:(NSString *)key
Parameters
key

The key that identifies the edge insets.

Return Value

The edge insets data.

Discussion

Use this method to decode size information that was previously encoded using the encodeUIEdgeInsets:forKey: method.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

decodeUIOffsetForKey:

Decodes and returns the UIOffset structure associated with the specified key in the receiver’s archive.

- (UIOffset)decodeUIOffsetForKey:(NSString *)key
Parameters
key

The key that identifies the offset.

Return Value

The offset data.

Discussion

Use this method to decode offset information that was previously encoded using the encodeUIOffset:forKey: method.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIGeometry.h

encodeCGAffineTransform:forKey:

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

- (void)encodeCGAffineTransform:(CGAffineTransform)transform forKey:(NSString *)key
Parameters
transform

The transform information 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 decodeCGAffineTransformForKey: method to retrieve the data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

encodeCGPoint:forKey:

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

- (void)encodeCGPoint:(CGPoint)point forKey:(NSString *)key
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 decodeCGPointForKey: method to retrieve the data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

encodeCGRect:forKey:

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

- (void)encodeCGRect:(CGRect)rect forKey:(NSString *)key
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 decodeCGRectForKey: method to retrieve the data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

encodeCGSize:forKey:

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

- (void)encodeCGSize:(CGSize)size forKey:(NSString *)key
Parameters
size

The size information 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 decodeCGSizeForKey: method to retrieve the data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

encodeUIEdgeInsets:forKey:

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

- (void)encodeUIEdgeInsets:(UIEdgeInsets)insets forKey:(NSString *)key
Parameters
insets

The edge insets data 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 decodeUIEdgeInsetsForKey: method to retrieve the data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

encodeUIOffset:forKey:

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

- (void)encodeUIOffset:(UIOffset)offset forKey:(NSString *)key
Parameters
offset

The offset data 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 decodeUIOffsetForKey: method to retrieve the data.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIGeometry.h