---
title: "CGRectGetMaxX(_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgrectgetmaxx(_:)"
---

# CGRectGetMaxX(_:)

Returns the largest value of the x-coordinate for the rectangle.

## Declaration

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

## Parameters

- `rect`: The rectangle to examine.

## Return Value

Return Value The largest value of the x-coordinate for the rectangle.

## See Also

### Getting Min, Mid, and Max Values

- [CGRectGetMinX(_:)](coregraphics/cgrectgetminx(_:).md)
- [CGRectGetMinY(_:)](coregraphics/cgrectgetminy(_:).md)
- [CGRectGetMidX(_:)](coregraphics/cgrectgetmidx(_:).md)
- [CGRectGetMidY(_:)](coregraphics/cgrectgetmidy(_:).md)
- [CGRectGetMaxY(_:)](coregraphics/cgrectgetmaxy(_:).md)
