Search code examples
iosobjective-cmkmapviewmapkitmkoverlay

Objective-C add MKOverlay to map view animated fade in


I've been trying to add an MKOverlay to a map with animation. I'm trying to make it fade in when it's added and fade out when it's removed. Could this be done by created a custom overlay class or overlay view class?


Solution

  • On iOS 7 you could achieve this even with the new MKOverlayRenderer. It has an alpha property which you could animate by setting up a timer to repeatedly change its value and call setNeedsDisplayInMapRect:zoomScale:.