user1543946
user1543946

Reputation: 43

How to get CGRect that exactly represents the views bounds and transformation?

How can I get the transformed rect of an UIView, including translations and scaling made in the .transform property? I tried to do it this way:

CGRect transformed = CGRectApplyAffineTransform(theview.frame, theview.transform);

Doesn't work!?

Upvotes: 0

Views: 1317

Answers (1)

Max
Max

Reputation: 16709

You should use UIView bounds property for that, i.e.

CGRect trans_rect = CGRectApplyAffineTransform(view.bounds, view.transform);

Upvotes: 2

Related Questions