I have a requirement in which i need to implement the feature to re size, rotate and move the view. i have implemented all three features but i am struggling with one issue for past one week i could not solve it.
If i try to resize the view by dragging its right corner after applying CGAffineTransformRotate, the view's frame gone to unpredictable state. I searched about this issue latter i came to know
If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.
I saw one app which has implemented same feature what i exactly wish to implement. In that app we can resize the view after rotation.
How can i resize the view by dragging its right corner after applying CGAffineTransformRotate
I do not have much experience in iOS app development,i am struggling with this issue for past one week if any one solve my problem it would be greatly appreciated.
My Sample Code
The documentation clearly says:
**If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.
If the transform property contains a non-identity transform, the value of the frame property is undefined and should not be modified. In that case, you can reposition the view using the center property and adjust the size using the bounds property instead.**
So, Just change the below line in touchesMoved from:
testVw.frame = CGRectMake(testVw.frame.origin.x, testVw.frame.origin.y,touchPoint.x + deltaWidth, touchPoint.y + deltaWidth);
to:
testVw.bounds = CGRectMake(testVw.bounds.origin.x, testVw.bounds.origin.y,touchPoint.x + deltaWidth, touchPoint.y + deltaWidth);
and your code will work perfectly fine.
Also, Add some border conditions.