---
title: "convert(_:toRectTo:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapview/convert(_:torectto:)"
---

# convert(_:toRectTo:)

Converts a map region to a rectangle in the specified view.

## Declaration

```swift
func convert(_ region: MKCoordinateRegion, toRectTo view: UIView?) -> CGRect
```

```swift
func convert(_ region: MKCoordinateRegion, toRectTo view: NSView?) -> CGRect
```

## Parameters

- `region`: The map region that you want to find the corresponding view rectangle for.
- `view`: The view where you want to locate the specified map region. If this parameter is nil, the method specifies the returned rectangle in the window’s coordinate system. If view isn’t nil, the rectangle belongs to the same window as the map view.

## Return Value

Return Value The rectangle corresponding to the specified map region.

## See Also

### Converting map coordinates

- [convert(_:toPointTo:)](mapkit/mkmapview/convert(_:topointto:).md)
- [convert(_:toCoordinateFrom:)](mapkit/mkmapview/convert(_:tocoordinatefrom:).md)
- [convert(_:toRegionFrom:)](mapkit/mkmapview/convert(_:toregionfrom:).md)
