I want to zoom and scroll a UIScrollView with a CGPathRef. Because of that I assume I have to animate the UIScrollView’s layer property? But which property would I animate that would make it equivalent to doing a UIView animation and setting its contentOffset property and zoomScale ?
These are not properties of a CALayer.
Any ideas as to how I would approach this? Again, just want to move the scrollview to a certain contentOffset and zoomScale, but not necessarily linearly from point A to point B, zoom A to zoom B, respectively.
I was thinking a CAKeyFrameAnimation with a CGPathRef, but I don’t know which properties to animate.
You have to animate the
boundsproperty. In fact, that’s what thecontentOffsetproperty uses behind the scenes.Example:
If you’re curious, the way I used to get this information is the following:
The
NSLogcall will output:The
animationssnippet will list all the active animations, in this case{ bounds=<CABasicAnimation: 0xec1e7c0>; }.Hope this helps.