Instance Method

convertRect:toRegionFromView:

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

Declaration

iOS, tvOS
- (MKCoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(UIView *)view;
macOS
- (MKCoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(NSView *)view;

Parameters

rect

The rectangle you want to convert.

view

The view that serves as the reference coordinate system for the rect parameter.

Return Value

The map region corresponding to the specified view rectangle.

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.

- convertRegion:toRectToView:

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