Skip to content

Instantly share code, notes, and snippets.


Tiago Martinho tiagomartinho

View GitHub Profile
aitskovi / GestureImage.m
Created Mar 4, 2011
A pannable, rotatable and zoomable image with gesture recognizers.
View GestureImage.m
- (id)initWithImage:(UIImage *)image {
if ((self = [super initWithImage:image])) {
self.userInteractionEnabled = YES;
self.multipleTouchEnabled = YES;
_pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchRecognized:)];
[self addGestureRecognizer:_pinchGestureRecognizer];
_pinchGestureRecognizer.delegate = self;
_panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panRecognized:)];
[self addGestureRecognizer:_panRecognizer];
_panRecognizer.delegate = self;
You can’t perform that action at this time.