/
SLGFourCornersTapGestureRecognizer.m
70 lines (58 loc) · 1.26 KB
/
SLGFourCornersTapGestureRecognizer.m
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// SGFFourCornersTapGestureRecognizer.m
//
// Created by Grace Steven on 7/6/11.
// Copyright 2011 works5.com All rights reserved.
//
#import "SLGFourCornersTapGestureRecognizer.h"
@implementation SLGFourCornersTapGestureRecognizer
#pragma mark - Corner Point Calculations
//
//
//
-(CGPoint)topLeftCorner{
return CGPointMake(1,1);
}
-(CGPoint)topRightCorner{
return CGPointMake(CGRectGetMaxX(self.view.bounds),0);
}
-(CGPoint)bottomRightCorner{
return CGPointMake(CGRectGetMaxX(self.view.bounds),CGRectGetMaxY(self.view.bounds));
}
-(CGPoint)bottomLeftCorner{
return CGPointMake(1,CGRectGetMaxY(self.view.bounds));
}
//
// OVERRIDE THE LOCATION AT INDEX FUNCTION TO RETURN THE CORNERS
//
-(CGPoint)touchPointAtIndex:(NSInteger)anIndex{
switch (anIndex) {
case 0:
return [self topLeftCorner];
case 1:
return [self topRightCorner];
case 2:
return [self bottomRightCorner];
case 3:
return [self bottomLeftCorner];
default:
return CGPointZero;
}
}
//
//
//
-(NSUInteger)numberOfRequiredTapLocations{
return 4;
}
/*
//
//
//
-(BOOL)checkIsRecognized{
if(self.currentLocationIndex == 4)
return YES;
return NO;
}
*/
@end