Răsfoiți Sursa

Add vertical swipe for closes opened PDF view

Marino Faggiana 7 ani în urmă
părinte
comite
8f907e1796

+ 1 - 0
iOSClient/Library/VFR Pdf Reader/Sources/ReaderViewController.h

@@ -38,6 +38,7 @@
 //TWS
 - (void)handleSingleTapReader;
 - (void)handleLongTappReader;
+- (void)handleSwipeUpDown;
 
 @end
 

+ 11 - 0
iOSClient/Library/VFR Pdf Reader/Sources/ReaderViewController.m

@@ -379,6 +379,10 @@
 	doubleTapTwo.numberOfTouchesRequired = 2; doubleTapTwo.numberOfTapsRequired = 2; doubleTapTwo.delegate = self;
 	[self.view addGestureRecognizer:doubleTapTwo];
     
+    UISwipeGestureRecognizer *swipeUpDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUpDown:)];
+    swipeUpDown.direction = UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp;
+    [self.view addGestureRecognizer:swipeUpDown];
+
     // TWS Long Press
     UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongTap:)];
     [self.view addGestureRecognizer:longPressRecognizer];
@@ -708,6 +712,13 @@
         [self.delegate handleLongTappReader];
 }
 
+- (void)handleSwipeUpDown:(UITapGestureRecognizer *)recognizer
+{
+    //TWS
+    if ([self.delegate respondsToSelector:@selector(handleSwipeUpDown)])
+        [self.delegate handleSwipeUpDown];
+}
+
 #pragma mark - ReaderContentViewDelegate methods
 
 - (void)contentView:(ReaderContentView *)contentView touchesBegan:(NSSet *)touches

+ 6 - 0
iOSClient/Main/CCDetail.m

@@ -854,6 +854,12 @@
     [self actionButtonPressed:nil];
 }
 
+- (void)handleSwipeUpDown
+{
+    [self removeAllView];
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Delete =====
 #pragma --------------------------------------------------------------------------------------------