1

When we perform a gesture(pan, rotate, swipe...etc), usually we navigate page, scrolling, etc. The back end recognize the gestures, that's all. What I am searching is more on UI. How can I make the screen to provide visual feedback of the gesture I have just performed? In other words, when user's finger is on the screen, example when

Swiping - one line displays on the screen, tab - one dot displays on the screen, rotate - two curve of lines display on the screen

Let me know if my question is not cleared enough.

1 Answers1

0

This question is quite a big ask. There are lots of different elements to it.

Firstly you'll need to detect gestures: How to detect Swipe Gesture in iPhone SDK?

You can find some code here on recognizing simple gestures.

Once you can recognize gestures, you can change the UIImage contained in a UIImageView programmatically like this:

UIImage *myImage = [UIImage imageNamed:@"swipe_pic.png"];
[myImageView setImage:myImage];

You can read more about UIImageView here.

Hope this helps you.

Community
  • 1
  • 1
Liam George Betsworth
  • 18,373
  • 5
  • 39
  • 42
  • Yeah, I know how to recognize the gestures. Your solution is to provide the gesture visual feedback using picture/image. What I am asking is like a painting. When your finger is on the screen, let say swipe, a swipe line will appear and gone after you done with the gesture. –  Jul 27 '12 at 06:03
  • It is like the app Fruit Ninja. When you swipe, you can see there is a visual feedback from your swipe. –  Jul 27 '12 at 06:12
  • Ok, but you didn't explicitly say that. You just asked for a dot or a slash on the screen. You'd do it the same way but you'd detect where the touch occurred. Then you'd programmatically place the image there. – Liam George Betsworth Jul 27 '12 at 08:47