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

# convert(_:toRegionFrom:)

Converts a rectangle in the specified view’s coordinate system to a map region.

## Declaration

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

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

## Parameters

- `rect`: The rectangle you want to convert.
- `view`: The view that serves as the reference coordinate system for the rect parameter.

## Return Value

Return Value The map region corresponding to the specified view rectangle.

## See Also

### Converting map coordinates

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