---
title: CGSize
framework: corefoundation
role: symbol
role_heading: Structure
path: corefoundation/cgsize
---

# CGSize

A structure that contains width and height values.

## Declaration

```swift
struct CGSize
```

## Overview

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 standardized function.

## Topics

### Geometric Properties

- [width](corefoundation/cgsize/width.md)
- [height](corefoundation/cgsize/height.md)

### Special Values

- [zero](corefoundation/cgsize/zero.md)
- [init()](corefoundation/cgsize/init().md)

### Transforming Sizes

- [applying(_:)](corefoundation/cgsize/applying(_:).md)

### Alternate Representations

- [dictionaryRepresentation](corefoundation/cgsize/dictionaryrepresentation.md)
- [init(dictionaryRepresentation:)](corefoundation/cgsize/init(dictionaryrepresentation:).md)
- [customPlaygroundQuickLook](corefoundation/cgsize/customplaygroundquicklook.md)

### Comparing Sizes

- [CGSizeEqualToSize(_:_:)](coregraphics/cgsizeequaltosize(_:_:).md)

### Initializers

- [init(_:)](corefoundation/cgsize/init(_:).md)
- [init(width:height:)](corefoundation/cgsize/init(width:height:)-2du3k.md)
- [init(width:height:)](corefoundation/cgsize/init(width:height:)-63ffm.md)
- [init(width:height:)](corefoundation/cgsize/init(width:height:)-83b96.md)

### Instance Properties

- [formattedDescription](corefoundation/cgsize/formatteddescription.md)

### Instance Methods

- [equalTo(_:)](corefoundation/cgsize/equalto(_:).md)

## Relationships

### Conforms To

- [Animatable](swiftui/animatable.md)
- [BitwiseCopyable](swift/bitwisecopyable.md)
- [CVAttachmentValueRepresentable](corevideo/cvattachmentvaluerepresentable.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Structures

- [CGAffineTransform](corefoundation/cgaffinetransform.md)
- [CGAffineTransformComponents](corefoundation/cgaffinetransformcomponents.md)
- [CGFloat](corefoundation/cgfloat-swift.struct.md)
- [CGPoint](corefoundation/cgpoint.md)
- [CGRect](corefoundation/cgrect.md)
- [CGVector](corefoundation/cgvector.md)
