spentak
spentak

Reputation: 4747

iOS How to flip view/image and preserve scale

I can flip my view by doing something like this:

image.transform = CGAffineTransformMakeScale(-1, 1);

My problem is if I have scaled the item in the app this code obviously sends it back to its original size and flips it. How can I maintain the current scale and flip the object?

Upvotes: 0

Views: 1285

Answers (1)

user23743
user23743

Reputation:

Get the context's current transformation matrix (CTM), and apply your flipping transform to that matrix.

Upvotes: 1

Related Questions