0

Possible Duplicate:
Tasks with my UIImageView

How can i highlight my UIImageview and display a deleteButton(cross button) on top of the imageview when user touching the UIImageview?.

Community
  • 1
  • 1
Vipin
  • 4,718
  • 12
  • 54
  • 81

2 Answers2

0

You need to create a IBAction that adds the cross button and wire it to the touchDown event in interface builder. You could probably make a timer that will give it a couple seconds before activating.

Option 2: read about gestureRecognizers, they are very simple and I learned them in a couple hours.

http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html <-- all about recogizers

Weston
  • 1,481
  • 1
  • 11
  • 31
0

It's pretty straight forward. Use

UILongPressGestureRecognizer

In the methods below write a code for detecting gestures and popping up a delete button.

- (void)handleGesture; //or
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer;

For deleting use

- (void)removeTarget:(id)target action:(SEL)action
Legolas
  • 12,145
  • 12
  • 79
  • 132