Hi Brody, great tutorial! I definitely found it useful. For the custom UIGestureRecognizer, I believe it’s possible to simply import UIKit.UIGestureRecognizerSubclass directly into the Swift file instead of adding the bridging header. Do you know if there is any downside to using this approach?
Hey @alex_andrews, it is possible to import UIKit.UIGestureRecognizerSubclass. I wasn’t aware of this so thanks for the tip! I don’t see any downside to importing directly in Swift and it saves you from having to create a bridging header. I was following Apple’s UIGestureRecognizer documentation which states:
The state property is declared in UIGestureRecognizer.h as being read-only. This property declaration is intended for clients of gesture recognizers. Subclasses of UIGestureRecognizer must import UIGestureRecognizerSubclass.h. This header file contains a redeclaration of state that makes it read-write.
You can use a custom UIGestureRecognizer to handle the touches and change view.transorm to resize the view. As for the corners, this stack overflow thread shows how to implement something like that.
Hi Brody, this tutorial really helped me! I implemented it elsewhere on a small View area with buttons. I can tilt and resize just fine. But when I press a button, the view re-centers itself on the screen. How can I maintain x-y through a simple button press?