I am doing an app which has a feature to rotate and re size a view. i have implemented this feature but i do face an issue.
My problem
The View
Since you don't use UIView animations you can save current view's transform, set view's transform to identity, resize the view and reapply saved transform:
UIView *v;
CGAffineTransform t = v.transform;
v.transform = CGAffineTransformIdentity;
CGFloat scale = 2.0f;
v.frame = CGRectMake(v.frame.origin.x, v.frame.origin.y, v.frame.size.width*scale , v.frame.size.height*scale);
v.transform = t;
(EDIT)About your resizing:
If you define your rectangle with 4 vectors (points) A,B,C,D where (A+C)*.5 = (B+D)*.5 = rectangle_center
Then for moving point C to position C' would also move B and D to B' and D':
A' = A
C' = C' //touch input
B' = A + (normalized(B-A) * dotProduct((C'-A), normalized(B-A)))
D' = A + (normalized(D-A) * dotProduct((C'-A), normalized(D-A)))
After that:
(.0f, .0f, length(A-D), length(A-C))
(A+D)*.5f
atanf(height/width)
and few "if's" OR fill/create transform with base vectors that are normalized(D-A)
and normalized(B-A)
You can do that for any point in a rectangle.