Instance Method

convert(_:toRegionFrom:)

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

Declaration

iOS, Mac Catalyst, tvOS
func convert(_ rect: CGRect, toRegionFrom view: UIView?) -> MKCoordinateRegion
macOS
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

The map region corresponding to the specified view rectangle.

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(MKCoordinateRegion, toRectTo: UIView?) -> CGRect

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