Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6786949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:18:23+00:00 2026-05-26T17:18:23+00:00

Ha ii ,i am doing a reader application which have chapters in it,i have

  • 0

Ha ii ,i am doing a reader application which have chapters in it,i have done the swipe recognition property in tableview for reloading tableview with next and previous chapters right-swipe for next and left swipe for previous.And at the same time i added button for same function in button click,the problem is when the chapter ends that means the book containing only 9 chapters and if i reach the 9th chapter the swipe propert for right have to be stopped and vice versa.But i have done it in button by disabling the button if the chapter 9 loda it atomatically disabled the button so the user didnt tap the button,i want this same methode in my swipe right and left function>how to do this this is my code for swipe

UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)];
    swipeGesture.direction = UISwipeGestureRecognizerDirectionRight; // or whatever
    [table addGestureRecognizer:swipeGesture];
    [swipeGesture release];
    UISwipeGestureRecognizer *swipeGestureleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGestureleft:)];
    swipeGestureleft.direction = UISwipeGestureRecognizerDirectionLeft; // or whatever
    [table addGestureRecognizer:swipeGestureleft];
    [swipeGestureleft release];
-(void) handleSwipeGesture:(UISwipeGestureRecognizer*)recognizer {

    delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] + 1];
    [delegate reloadVerses];
    [self resetReadViewToVerse:1]; 
}

EDIT:::
-(void) handleSwipeGestureleft:(UISwipeGestureRecognizer*)recognizer {

    delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] - 1];
    [delegate reloadVerses];
    [self resetReadViewToVerse:1]; 
}

this is the method where i hides the button or disabled the button here i want to stop and start the gesture.Please help me.
Thanks in advance.
Thanks in advance.
edit

-(void)resetReadViewToVerse:(int)verseNo;
{
    if(![delegate.selectedChapter isEqualToString:@"1"])
    {
        previousButton.enabled = YES; 
        table.tableHeaderView =previousButton;


    }
    else
    {
        previousButton.enabled = NO;
        table.tableHeaderView =nil;

    }

    if(![delegate.selectedChapter isEqualToString:[NSString stringWithFormat:@"%d",[DbHandler mNumberOfChaptersInBook:delegate.selectedBook]]])
    {
        nextButton.enabled =YES;
        table.tableFooterView =nextButton;


    }
    else
    {
        nextButton.enabled = NO;
        table.tableFooterView =nil;

    }
    -(void) handleSwipeGesture:(UISwipeGestureRecognizer*)recognizer {


     if(![delegate.selectedChapter isEqualToString:[NSString stringWithFormat:@"%d",[DbHandler mNumberOfChaptersInBook:delegate.selectedBook]]]) {
        // if the currentChapter is the last then do nothing
         delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] + 1];
         [delegate reloadVerses];
         [self resetReadViewToVerse:1];
    }
    return;



}
-(void) handleSwipeGestureleft:(UISwipeGestureRecognizer*)recognizer {

    if(![delegate.selectedChapter isEqualToString:@"1"])
    {
        delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] - 1];
        [delegate reloadVerses];
        [self resetReadViewToVerse:1]; 
    }
    return;


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:18:24+00:00Added an answer on May 26, 2026 at 5:18 pm

    You don’t need to deactivate the gesture you just need to check that the selectedChapter + 1 is not more than the total number of chapters, if it is you ignore the gesture.

    EDIT:

    You can do something like this (assuming you can ask the delegate totalNumberOfChapters):

    -(void) handleSwipeGesture:(UISwipeGestureRecognizer*)recognizer {
    
        // delegate.selectedChapter should be NSInteger, would be easier
    
        NSInteger currentChapter = [delegate.selectedChapter integerValue];
    
        if (currentChapter >= delegate.totalNumberOfChapters) {
            // if the currentChapter is the last then do nothing
            return;
        }
    
        delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] + 1];
        [delegate reloadVerses];
        [self resetReadViewToVerse:1]; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a reader application in iPhone which have a loginpage the login
I am doing a reader application which can send text to Facebook. But I
Ha ii everybody i am doing a reader application which has so many functionality
I have a .net application which runs in the region of 20 to 30
I have an ASP.NET application which runs under the Classic .NET AppPool in IIS.
I have a url which serves data to my android application, i learnt from
I have a form within my Asp.Net MVC application which returns a Null reference
I have an ASP.NET web application, which operates just fine on IE7, IE8, IE8(Compatibility
I have a web application which among other things contains a table of items
I want to use an access card reader with PHP. I am doing this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.