Converts a map region to a rectangle in the specified view.
SDKs
- iOS 3.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.2+
Framework
- Map
Kit
Declaration
func convert(_ region: MKCoordinate Region, toRectTo view: UIView?) -> CGRect
func convert(_ region: MKCoordinate Region, 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. Ifview
is notnil
, it must belong to the same window as the map view.
Return Value
The rectangle corresponding to the specified map region.