I am trying to display an animated gif in an overlay for MKMapView
. The overlay is created using the MKOverlayRenderer
. To animate the gif in iOS
Because a map view overlay is having your draw in a CGContext
, it won't animate -- that is a buffer which is drawn to and translated to view contents, as opposed to being a normal part of the view hierarchy. Unfortunately you will need to make use of -setNeedsDisplayInMapRect:zoomScale:
repeatedly to request animations. This system is a bit less flexible than iOS 6 and before, which added normal views atop the map.
https://github.com/jhurray/iOS7AnimatedMapOverlay
this is the best way to animate overlays in iOS7