summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/TapImage.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/Classes/TapImage.m')
-rw-r--r--platform/ios/Classes/TapImage.m37
1 files changed, 0 insertions, 37 deletions
diff --git a/platform/ios/Classes/TapImage.m b/platform/ios/Classes/TapImage.m
deleted file mode 100644
index 1a43813e..00000000
--- a/platform/ios/Classes/TapImage.m
+++ /dev/null
@@ -1,37 +0,0 @@
-#import "TapImage.h"
-
-static const NSTimeInterval TapDuration = 0.05;
-
-@implementation TapImage
-
-- (id)initWithResource:(NSString *)resource target:(id)targ action:(SEL)selector
-{
- UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:resource ofType:@"png"]];
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
- image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
- self = [super initWithImage:image];
- if (self)
- {
- target = targ;
- action = selector;
- UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTap)];
- [self addGestureRecognizer:tap];
- [tap release];
- }
- return self;
-}
-
-- (void) onTap
-{
- [UIView animateWithDuration:TapDuration animations:^{
- self.backgroundColor = [UIColor darkGrayColor];
- } completion:^(BOOL finished) {
- [UIView animateWithDuration:TapDuration animations:^{
- self.backgroundColor = [UIColor clearColor];
- } completion:^(BOOL finished) {
- [target performSelector:action withObject:nil];
- }];
- }];
-}
-
-@end