How to limit panning and zooming in-out area?

164 views Asked by At

in my app i am having one image view which contains the picture of user taken from either camera or phone library(album).And the user is allowed to select some product from a list of products for trying on his picture. I am able to do all this stuff and also i am able to do the panning, zooming and also rotation on the product. But my problem is, when i am moving this product it is going out of the image view that contains the users picture and same thing happening with the zooming ..Please help me through this..Thanks in advance..

1

There are 1 answers

0
Hooda On BEST ANSWER

You need to restrict it in the frame of outerview.

so CGRECT methods can serve your purpose.

such as

CGRectIntersectsRect
CGRectContainsPoint

for reference see this

and for zooming purpose see this