I want to rotate the image in clockwise or anticlockwise direction corresponding to the user touch drag with its speed. I think this can be done with some math and logic. What would a code sample for this look like?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
If you're targeting iOS 3.2 or greater, you can use
UIRotationGestureRecognizer
. The code would look something like this:In your setup method (
viewDidLoad
orinit
, etc,):The event handler:
I have some more examples of gesture recognizers (including the one above) on github.