Instance Method

convert(_:toRegionFrom:)

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

Declaration

iOS, 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?)

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

func convert(CGPoint, toCoordinateFrom: UIView?)

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

func convertRegion(MKCoordinateRegion, toRectTo: UIView?)

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