0

i want to detect when user uses one finger to make a circular motion on a UIView

any help will be appreciated

Monty
  • 341
  • 1
  • 4
  • 13

2 Answers2

1

Subclass youe UIView and implement

– touchesBegan:withEvent:
– touchesMoved:withEvent:
– touchesEnded:withEvent:
– touchesCancelled:withEvent: 

In touch moved you get the new touch points and you can see if the touch points are on a circle arc.

Alex Terente
  • 12,006
  • 5
  • 51
  • 71
  • hehe i know that :), how can i determine from the points i get that the user is moving in a circle – Monty Mar 12 '12 at 10:25
0

I know it's bad practice to answer with a bunch of links. But so is reinventing the wheel.

Take a look at:

Recognising a circle gesture to drop an annotation, how to detect circle?

How to detect a circle motion with UIGestureRecognizer

How to detect circular gesture via Gesture Recognizer?

All the linked questions include accepted answers.

Community
  • 1
  • 1
Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
  • you should close the question for duplicate. Not copy paste some links that are on stack. – Alex Terente Mar 12 '12 at 13:20
  • @AlexTerente: i think sometimes a list of 80% 'duplicates' is much more informative (for OP and later for others) and useful that simply closing question as a duplicate. Each of these 'duplicates' holds a number of further references. If they ALL could be joined under one meta-question: then i'd agree – Rok Jarc Mar 12 '12 at 18:00