summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/TapImage.m
blob: e02e8b7acb4633bd6195b6a688c22b4f46e09d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#import "TapImage.h"

@implementation TapImage

- (id)initWithResource:(NSString *)resource target:(id)targ action:(SEL)selector
{
	UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:resource ofType:@"png"]];
	self = [super initWithImage:image];
	if (self)
	{
		UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:targ action:selector];
		[self addGestureRecognizer:tap];
		[tap release];
	}
	return self;
}

@end