UIView Rotation using CGAffineTransform - iphone

I want to rotate an UIView using CGAffineTransform and I'm able to rotate View using CGAffineTransform.
But I want to rotate UIView smoothly on finger touch based on swipe gestures.
So like right swipe, left swipe I was able to detect swipe but when I swipe from down to right or from down to left, I'm not able to detect swipe gesture of these types...

Sanjay these are the only allowable gestures that a iPhone supports
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/instp/UISwipeGestureRecognizer/direction
so I think you are trying to recognize a diagonal swipe gesture and the its not working.
and also there is a minimum numberOfTouchesRequired required for swipe gesture.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UISwipeGestureRecognizer
And if you want to rotate a UIView object than I think you will find the code in this link
rotating a view on touch
Hope this helps.

Related

UIPanGestureRecognizer - Avoid moving two images simultaneously - Swift

I have a ViewController with 3 UIImageView with its images. I am using Pinch, Pan and Rotate gesture on all three images. While doing Pinch or Rotation i got two finger point with opt+mouse_click. There in the finger point, if two images are pointed with each finger point, both images are moving around.
I actually don't want that move(pan) while doing opt+mouse_click, just need to rotate or zoom the images with two finger points.
Help me to resolve, Thanks in advance
You can try to limit the UIPanGestureRecognizer 's finger that touch on screen to 1 to avoid it. Rotate or zoom will need 2 fingers.
More information from Apple's doc
The maximum number of fingers that can be touching the view for this gesture to be recognized.
https://developer.apple.com/documentation/uikit/uipangesturerecognizer/1621208-maximumnumberoftouches

How to implement an angle detecting swipe gesture recognizer in SceneKit?

What I basically want to do is allow a user to swipe on their screen in any forward facing direction to launch a projectile at a target in that direction. I did look over UISwipeGestureRecognizer but I wasn't able to figure out how to implement one that allows swiping in any angle while also allowing me to determine the angle to launch the projectile.
See the "Methods for Subclasses" section of the UIGestureRecognizer class doc. You should be able to override touchesBegan/Moved/Ended in your UISwipeGestureRecognizer subclass, and determine the angle to launch.

How do we detect swipe gesture when we zoom uiscrollview

I have UIImageview as a subview of UIScrollview, I can zoom in or out by using this
tutorial http://cocoadevblog.heroku.com/iphone-tutorial-uiimage-with-zooming-tapping-rotation, the problem is how can I detect swipe gesture when I zoom UIScrollview in,
I know how to implement swipe gesture, and it work normally except when I zoom UIScrollview in.
Thank you very much for your time.
have a look at following links,hope it helps ..
How to implement zooming *and* paging like iOS Photos app
How to implement Swipe Gesture for UIImageView randomizer

How can I have pinch zoom and two-finger rotation at the same time on an UIImageView?

I have an Image View and I need to be able to pinch-zoom it, scroll it when it is zoomed and also rotate it with two-finger.
Initially I used a scrollView and added ImageView to it. but ImageView wasnt getting rotation gestures as ScrollView was intercepting them.
So I added the gesture to the ScrollView started rotating the scrollView itself.
Things work fine but rotated scrollView doesn't look good.
So I made the ScrollView get the rotation gesture but rotated the imageView in it instead of ScrollView.
But Now, the problem is If I rotate the image and then zoom and again try to rotate, previous rotation is lost and same when I rotate the previous zoom level is lost.
How should I go about it ? Is the scrollView unnecessary ?

How to detect horizontal swipe gesture on the custom UIScrollView?

I created custom UIScrollView and add UIImageView.
I want to detect horizontal swipe gesture on the UIScrollView, but I cannot do it.
I cannot find any other references in my case.
I found only following url, but it's not real detecting gesture.
How to recognize swipe gesture in UIScrollView
I've not any zoom effect.
Please help me.
Doesn't one of the UIScrollViewDelegate methods such as [UIScrollViewDelegate scrollViewDidScroll:] work for you? I don't know your specific case, but standard way of detecting swipe action in UIScrollView should be through its delegate.