Instance Method

convertRegion:toRectToView:

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

Declaration

iOS, tvOS
- (CGRect)convertRegion:(MKCoordinateRegion)region toRectToView:(UIView *)view;
macOS
- (CGRect)convertRegion:(MKCoordinateRegion)region toRectToView:(NSView *)view;

Parameters

region

The map region for which you want to find the corresponding view rectangle.

view

The view in whose coordinate system you want to locate the specified map region. If this parameter is nil, the returned rectangle is specified in the window’s coordinate system. If view is not nil, it must belong to the same window as the map view.

Return Value

The rectangle corresponding to the specified map region.

See Also

Converting Map Coordinates

- convertCoordinate:toPointToView:

Converts a map coordinate to a point in the specified view.

- convertPoint:toCoordinateFromView:

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

- convertRect:toRegionFromView:

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