jkally
jkally

Reputation: 814

How do I make my UIImageview respond to a swipe gesture

e.g. swap in another UIImage,etc.

Upvotes: 0

Views: 472

Answers (2)

Anomie
Anomie

Reputation: 94794

I see you tagged this [iphone-sdk-3.0]. If you can use SDK 3.2 or later, you can do it easily with UISwipeGestureRecognizer. If you must stick with 3.0, you'll have to subclass UIImageView and process touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent:, and/or touchesCancelled:withEvent:.

Upvotes: 2

Anurag
Anurag

Reputation: 141879

A UIImageView is a subclass of UIView. You can add gesture recognizers to any view using addGestureRecognizer:.

Upvotes: 2

Related Questions