exchangeOverlay(_:with:)
Exchanges the positions of two overlay objects.
Declaration
func exchangeOverlay(_ overlay1: any MKOverlay, with overlay2: any MKOverlay)Parameters
- overlay1:
The first overlay object.
- overlay2:
The second overlay object.
Discussion
If the overlays are in the same map level, they exchange positions within that level’s array of overlay objects. If they’re in different map levels, the two objects also swap levels. Swapping the position of the overlays affects their visibility in the map view.