---
title: "convert(_:from:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiwindow/convert(_:from:)-10p2b"
---

# convert(_:from:)

Converts a rectangle from the coordinate system of another window to coordinate system of the current window.

## Declaration

```swift
func convert(_ rect: CGRect, from window: UIWindow?) -> CGRect
```

## Parameters

- `rect`: A rectangle in the coordinate system of window.
- `window`: The source window containing the specified rect. Specify nil to convert the rectangle from the logical coordinate system of the screen, which is measured in points.

## Return Value

Return Value The converted rectangle.

## See Also

### Converting coordinates

- [convert(_:to:)](uikit/uiwindow/convert(_:to:)-687rw.md)
- [convert(_:from:)](uikit/uiwindow/convert(_:from:)-1gbm1.md)
- [convert(_:to:)](uikit/uiwindow/convert(_:to:)-7k3l0.md)
