Note that there are some explanatory texts on larger screens.

plurals
  1. POIncrease Pages After Each Swipe Objective-C
    text
    copied!<p>I have one <code>UIViewController</code> and inside it I have 3 <code>UIWebView</code>. I added swipe left to my webViews programatically. Right now I can swipe, but just 3 pages and then repeat again. I want to increase my currentPage and add this to my webView3, but I don't know how should I do that.</p> <p>Would you please give me some hints? I really have problem in this part!</p> <p>Here is my code:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; NSLog(@"test view"); NSURL *url = [NSURL fileURLWithPath:[ [ NSBundle mainBundle ] pathForResource: @"Name/Name1" ofType:@"html" ]]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView2 loadRequest:request]; [webView2 bringToFront]; NSURL *url = [NSURL fileURLWithPath:[ [ NSBundle mainBundle ] pathForResource: @"Name/Name2" ofType:@"html" ]]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView3 loadRequest:request]; UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftAction:)]; swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft; swipeLeft.delegate = self; [self.view addGestureRecognizer:swipeLeft]; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } </code></pre> <p>currentPage is an integer and at the beginning it is 0. My question is how should I add my currentPage to webView3 so that when I Swipe it increase my pages?</p> <pre><code> - (void)swipeLeftAction:(id)ignored { NSLog(@"Swipe Left"); UIWebView *temp = webView2 ; webView2 = webView3; webView3 = webView; webView = temp; [webView2 bringToFront]; currentPage++; } </code></pre> <p>Thanks in advance!</p> <p>****Edit:** </p> <p>This current page is not connected to any webView, How Can I get this increase in my webView?** </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload