NB: everything I found is too old or way too different from what I actually need, also I tried almost everything I found and nothing worked the right way.
I created 3 UIViews, I can drag them around and zoom them. Now, I need to:
- Bring some of them to the front: I want to add to each of them an UITapGesture that allows me to bring the tapped UIView to the front passing the other UIViews to the back;
- Set a max/ min scale for the UIPinchGestureRecognizer so that I can't have super large UIiews or tiny UIViews;
- Set a sort of screen limit to the UIPanGestureRecognizer so that I can't drag my UIViews outside of the main view.
Here's my code:
I solved my problem!
ecc... BUT you can't do this if you want to limit the pan gesture as well, so you might want to add a tap gestureRecognizer instead:
Add a gestureRecognizer to your view and set the delegate.
In your viewDidLoad: