-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyApplication.h
53 lines (43 loc) · 1.46 KB
/
MyApplication.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// MyApplication.h
// FitVoice
//
// Created by Brian Clark on 2/22/14.
// Copyright (c) 2014 FitVoice. All rights reserved.
//
#ifndef FitVoice_MyApplication_h
#define FitVoice_MyApplication_h
@interface MyApplication : UIApplication
@end
@implementation MyApplication
- (void)sendEvent:(UIEvent *)event {
//NSSet *touches = [event allTouches];
//UITouch *oneTouch = [touches anyObject];
//UIView *touchView = [oneTouch view];
/*if(touches && oneTouch && touchView) {
} else if(touches && oneTouch) {
NSLog(@"Can't detect View");
}*/
if (event.type == UIEventTypeTouches) {
NSLog(@"Touch event Time: %f", event.timestamp);
// UITouch *touch = [event allTouches].anyObject;
// if (touch.phase == UITouchPhaseBegan) {
// Calling some methods
// }
// NSLog(@"Touches: %@", event.allTouches);
NSArray *array = [event.allTouches allObjects];
UITouch *touch = array[0];
NSLog(@"Touch: %@", touch);
NSLog(@"Gesture Recognizers: %@", touch.gestureRecognizers);
UIView *touchedView = touch.view;
if([touchedView isKindOfClass:[UIButton class]]) {
//NSLog(@"Button");
UIButton *pressedButton = (UIButton*)touch.view;
NSString *buttonText = pressedButton.titleLabel.text;
if(buttonText) NSLog(@"Text: %@", buttonText);
}
}
[super sendEvent:event];
}
@end
#endif