-
Notifications
You must be signed in to change notification settings - Fork 2
/
GXGesturedButton.h
41 lines (33 loc) · 1.03 KB
/
GXGesturedButton.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
//
// GXGesturedButton.h
// Thueyts
//
// Created by Mathieu Godart on 09/07/10.
// Copyright 2010 Cogetic. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXGesturedButton : UIButton {
id target;
SEL swipeUpAction;
SEL swipeDownAction;
SEL swipeRightAction;
SEL swipeLeftAction;
SEL tapHalfUpAction;
SEL tapHalfDownAction;
SEL tapTwoFingersAction;
}
typedef NSUInteger GXGesturedButtonEvent;
enum {
GXGesturedButtonEventSwipeUp = 1 << 0,
GXGesturedButtonEventSwipeDown = 1 << 1,
GXGesturedButtonEventSwipeLeft = 1 << 2,
GXGesturedButtonEventSwipeRight = 1 << 3,
GXGesturedButtonEventTapHalfUp = 1 << 4,
GXGesturedButtonEventTapHalfDown = 1 << 5,
GXGesturedButtonEventTapTwoFingers = 1 << 6
};
@property (nonatomic, retain) IBOutlet id target;
// TODO: Add a protocol here. Action must respond to action:(id)sender.
- (void)addAction:(SEL)action forControlEvent:(GXGesturedButtonEvent)controlEvent;
- (void)handleTap:(UITapGestureRecognizer *)sender;
@end