I'm fiddling with my MKMapView
in Playground, and I'm having trouble animating it's frame.size.height
. Here's my Playground code:
let vc = UIViewController()
vc.view.backgroundColor = UIColor.whiteColor()
XCPlaygroundPage.currentPage.liveView = vc
let map = MKMapView(frame: vc.view.frame)
map.backgroundColor = UIColor.redColor()
map.autoresizesSubviews = false
vc.view.addSubview(map)
UIView.animateWithDuration(2.0, delay: 1.0, usingSpringWithDamping: 0.5, initialSpringVelocity: 1.0, options: .CurveEaseInOut, animations: {
map.frame.size.height = 200
}, completion: nil)
You can tell when the actual animation is occurring by observing the map's red background color. The visible map's height decreases before the MKMapView
's height. Setting autoresizesSubviews = false
doesn't seem to do anything. So why does it seem as if there are two distinct animations?
UPDATE In my Playground, I removed all my MKMapView
subviews, and the _MKMapContentView
, one of the map's two subviews (the other being the "Legal" MKAttributionLabel
), was removed, rendering the MKMapView
with just it's red background. So the _MKMapContentView
is being resized as a subview, but calling map.autoresizesSubviews = false
isn't doing the trick. What gives?