Structure

CGSize

A structure that contains width and height values.

Declaration

typedef struct CGSize {
    ...
} CGSize;

Overview

A CGSize structure is sometimes used to represent a distance vector, rather than a physical size. As a vector, its values can be negative. To normalize a CGRect structure so that its size is represented by positive values, call the CGRectStandardize function.

Topics

Alternate Representations

CGSizeCreateDictionaryRepresentation

Returns a dictionary representation of the specified size.

Comparing Sizes

CGSizeEqualToSize

Returns whether two sizes are equal.

Instance Properties

height

A height value.

width

A width value.

See Also

Geometric Data Types

CGPoint

A structure that contains a point in a two-dimensional coordinate system.

CGRect

A structure that contains the location and dimensions of a rectangle.

CGVector

A structure that contains a two-dimensional vector.

CGAffineTransform

An affine transformation matrix for use in drawing 2D graphics.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software