/
DJIPlaybackMultiSelectViewController.m
137 lines (112 loc) · 4.06 KB
/
DJIPlaybackMultiSelectViewController.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//
// DJIPlaybackMultiSelectViewController.m
// DroneApplication
//
// Created by Bryan Ayllon on 8/18/16.
// Copyright © 2016 DJI. All rights reserved.
//
#import "DJIPlaybackMultiSelectViewController.h"
@interface DJIPlaybackMultiSelectViewController ()
@property(nonatomic, strong) UISwipeGestureRecognizer *swipeLeftGesture;
@property(nonatomic, strong) UISwipeGestureRecognizer *swipeRightGesture;
@property(nonatomic, strong) UISwipeGestureRecognizer *swipeUpGesture;
@property(nonatomic, strong) UISwipeGestureRecognizer *swipeDownGesture;
- (IBAction)selectFirstItemBtnAction:(id)sender;
- (IBAction)selectSecondItemBtnAction:(id)sender;
- (IBAction)selectThirdItemBtnAction:(id)sender;
- (IBAction)selectFourthItemBtnAction:(id)sender;
- (IBAction)selectFifthItemBtnAction:(id)sender;
- (IBAction)selectSixthItemBtnAction:(id)sender;
- (IBAction)selectSeventhItemBtnAction:(id)sender;
- (IBAction)selectEighthItemBtnAction:(id)sender;
@end
@implementation DJIPlaybackMultiSelectViewController
- (void)dealloc
{
}
- (void)viewDidLoad {
[super viewDidLoad];
self.swipeLeftGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftGestureAction:)];
self.swipeLeftGesture.direction = UISwipeGestureRecognizerDirectionLeft;
self.swipeRightGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRightGestureAction:)];
self.swipeRightGesture.direction = UISwipeGestureRecognizerDirectionRight;
self.swipeUpGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUpGestureAction:)];
self.swipeUpGesture.direction = UISwipeGestureRecognizerDirectionUp;
self.swipeDownGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeDownGestureAction:)];
self.swipeDownGesture.direction = UISwipeGestureRecognizerDirectionDown;
[self.view addGestureRecognizer:self.swipeLeftGesture];
[self.view addGestureRecognizer:self.swipeRightGesture];
[self.view addGestureRecognizer:self.swipeUpGesture];
[self.view addGestureRecognizer:self.swipeDownGesture];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark UIGestureAction Methods
- (void)swipeLeftGestureAction:(UISwipeGestureRecognizer *)gesture
{
if (self.swipeGestureAction) {
self.swipeGestureAction(UISwipeGestureRecognizerDirectionLeft);
}
}
- (void)swipeRightGestureAction:(UISwipeGestureRecognizer *)gesture
{
if (self.swipeGestureAction) {
self.swipeGestureAction(UISwipeGestureRecognizerDirectionRight);
}
}
- (void)swipeUpGestureAction:(UISwipeGestureRecognizer *)gesture
{
if (self.swipeGestureAction) {
self.swipeGestureAction(UISwipeGestureRecognizerDirectionUp);
}
}
- (void)swipeDownGestureAction:(UISwipeGestureRecognizer *)gesture
{
if (self.swipeGestureAction) {
self.swipeGestureAction(UISwipeGestureRecognizerDirectionDown);
}
}
#pragma mark UIButton Action Methods
- (IBAction)selectFirstItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(0);
}
}
- (IBAction)selectSecondItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(1);
}
}
- (IBAction)selectThirdItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(2);
}
}
- (IBAction)selectFourthItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(3);
}
}
- (IBAction)selectFifthItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(4);
}
}
- (IBAction)selectSixthItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(5);
}
}
- (IBAction)selectSeventhItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(6);
}
}
- (IBAction)selectEighthItemBtnAction:(id)sender {
if (self.selectItemBtnAction) {
self.selectItemBtnAction(7);
}
}
@end