<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIWindow/convert(_:from:)-10p2b",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIWindow(im)convertRect:fromWindow:"
  },
  "title" : "convert(_:from:)"
}
-->

# convert(_:from:)

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

```
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

The converted rectangle.

---

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)