5. Transforms
Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.
Morpheus, The Matrix
In Chapter 4, “Visual Effects,” we looked at some techniques to enhance the appearance of layers and their contents. In this chapter, we investigate CGAffineTransform
, which can be used to rotate, reposition, and distort our layers, and at CATransform3D
, which can change boring flat rectangles (albeit rounded rectangles with drop-shadows) into three-dimensional surfaces.
Affine Transforms
In Chapter 3, “Layer Geometry,” we made use of the UIView transform
property to rotate the hands on a clock, but we didn’t really explain what was going on behind the scenes. The UIView transform
property is of type CGAffineTransform
, and ...
Get iOS Core Animation: Advanced Techniques now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.