Instance Method

convertRect:toRegionFromView:

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

Declaration

iOS, Mac Catalyst, 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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software