Search code examples
iosmatrix2dtransformcgaffinetransform

iOS 2D Transforms: Library to use


I have to perform some 2D transforms under iOS. I know that you can use the transform property of UIView to apply transforms so I am assuming that somewhere there is some optimized code that one could call on. However I'm also pretty sure that this stuff is on top of openGL so...

What could I use to do some simple transforms (fastly) on iOS? I just need to translate and rotate points.


Solution

  • Using CGAffineTransform one can build combined transformation matrices and then apply them to a CGPoint, CGSize or CGRect. See the documentation here especially Applying Affine Transformations