Instance Method

convert(_:toRectTo:)

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

Declaration

iOS, tvOS
func convert(_ region: MKCoordinateRegion, toRectTo view: UIView?) -> CGRect
macOS
func convert(_ region: MKCoordinateRegion, toRectTo view: NSView?) -> CGRect

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

func convert(CLLocationCoordinate2D, toPointTo: UIView?) -> CGPoint

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

func convert(CGPoint, toCoordinateFrom: UIView?) -> CLLocationCoordinate2D

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

func convert(CGRect, toRegionFrom: UIView?) -> MKCoordinateRegion

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