And Functions:
//Swpie left goes to next page on ePub
-(void)swipeLeftAction:(UISwipeGestureRecognizer *) swipe{ [self executeJavaScript:@"ReadiumSDK.reader.openPageNext()" completionHandler:nil]; NSLog(@"%s","Swipe Left");}
//Swipe right goes to previous page on epub
-(void)swipeRightAction:(UISwipeGestureRecognizer *) swipe{ [self executeJavaScript:@"ReadiumSDK.reader.openPagePrev()" completionHandler:nil]; NSLog(@"%s","Swipe Right");}
So far no errors have occurred, after testing several times on multiple ePubs,
please feel free to check the code and comment back.
This branch allows swpie navigation for the ios app. A very simple commit which only required one page to be modified.
Code Changes:
EPubViewController.m
Added:-(void) viewDidLoad{ [super viewDidLoad]; UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRightAction:)]; //swipeRight.direction = UISwipeGestureRecognizerDirectionRight; [swipeRight setDirection:UISwipeGestureRecognizerDirectionRight]; //swipeRight.delegate = self; [m_webViewUI addGestureRecognizer:swipeRight]; [m_webViewWK addGestureRecognizer:swipeRight]; UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftAction:)]; //swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft; [swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft]; //swipeLeft.delegate = self; [m_webViewUI addGestureRecognizer:swipeLeft]; [m_webViewWK addGestureRecognizer:swipeLeft];}
And Functions: //Swpie left goes to next page on ePub
-(void)swipeLeftAction:(UISwipeGestureRecognizer *) swipe{ [self executeJavaScript:@"ReadiumSDK.reader.openPageNext()" completionHandler:nil]; NSLog(@"%s","Swipe Left");}
//Swipe right goes to previous page on epub
-(void)swipeRightAction:(UISwipeGestureRecognizer *) swipe{ [self executeJavaScript:@"ReadiumSDK.reader.openPagePrev()" completionHandler:nil]; NSLog(@"%s","Swipe Right");}
So far no errors have occurred, after testing several times on multiple ePubs, please feel free to check the code and comment back.
Thanks for this awesome framework 👍