---
title: "convert(_:from:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicoordinatespace/convert(_:from:)-9921a"
---

# convert(_:from:)

Converts a rectangle from the specified coordinate space to the coordinate space of the current object.

## Declaration

```swift
func convert(_ rect: CGRect, from coordinateSpace: any UICoordinateSpace) -> CGRect
```

## Parameters

- `rect`: A rectangle in the specified coordinate space.
- `coordinateSpace`: The coordinate space in which rect is specified.

## Return Value

Return Value A rectangle specified in the coordinate space of the current object.

## See Also

### Converting between coordinate spaces

- [convert(_:to:)](uikit/uicoordinatespace/convert(_:to:)-2ub7a.md)
- [convert(_:from:)](uikit/uicoordinatespace/convert(_:from:)-3w27q.md)
- [convert(_:to:)](uikit/uicoordinatespace/convert(_:to:)-3imkt.md)
