---
title: "CGRectGetHeight(_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgrectgetheight(_:)"
---

# CGRectGetHeight(_:)

Returns the height of a rectangle.

## Declaration

```swift
func CGRectGetHeight(_ rect: CGRect) -> CGFloat
```

## Parameters

- `rect`: The rectangle to examine.

## Return Value

Return Value The height of the specified rectangle.

## Discussion

Discussion Regardless of whether the height is stored in the CGRect data structure as a positive or negative number, this function returns the height as if the rectangle were standardized. That is, the result is never a negative number.

## See Also

### Getting Height and Width

- [CGRectGetWidth(_:)](coregraphics/cgrectgetwidth(_:).md)
