<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CGSize",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@S@CGSize"
  },
  "title" : "CGSize"
}
-->

# CGSize

A structure that contains width and height values.

```
struct CGSize
```

## Overview

A [`CGSize`](/documentation/CoreFoundation/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`](/documentation/CoreFoundation/CGRect) structure so that its size is represented by positive values, call the [`standardized`](/documentation/CoreFoundation/CGRect/standardized) function.

## Topics

### Geometric Properties

[`width`](/documentation/CoreFoundation/CGSize/width)

A width value.

[`height`](/documentation/CoreFoundation/CGSize/height)

A height value.

### Special Values

[`zero`](/documentation/CoreFoundation/CGSize/zero)

[`init()`](/documentation/CoreFoundation/CGSize/init())

Creates a size with zero width and height.

### Transforming Sizes

[`applying(_:)`](/documentation/CoreFoundation/CGSize/applying(_:))

### Alternate Representations

[`dictionaryRepresentation`](/documentation/CoreFoundation/CGSize/dictionaryRepresentation)

[`init(dictionaryRepresentation:)`](/documentation/CoreFoundation/CGSize/init(dictionaryRepresentation:))

[`customPlaygroundQuickLook`](/documentation/CoreFoundation/CGSize/customPlaygroundQuickLook)

A custom playground Quick Look for this instance.

### Comparing Sizes

  <doc://com.apple.documentation/documentation/CoreGraphics/CGSizeEqualToSize(_:_:)>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)