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 8982023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:28:51+00:00 2026-06-15T20:28:51+00:00

I want UIScrollView to scroll fast after fast sweep, like this . Although, when

  • 0

I want UIScrollView to scroll fast after fast sweep, like this.
Although, when paging is turned on, the scroll works one page at a time.
Is it possible to scroll fast, when paging is enabled with a flick of a finger without manually implementation using gesture recognizers?

  • 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-06-15T20:28:53+00:00Added an answer on June 15, 2026 at 8:28 pm

    This is fairly straightforward, however you must implement the paging aspect yourself (which is fairly simple). You don’t need gesture recognizers.

    Swift

    First, adjust your UIScrollView deceleration rate:

    scrollView.decelerationRate = UIScrollViewDecelerationRateFast
    

    Assume we have an array of content — let’s call it yourPagesArray. In your UIScrollViewDelegate, implement the following method:

    func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>)
    {
        //This is the index of the "page" that we will be landing at
        let nearestIndex = Int(CGFloat(targetContentOffset.pointee.x) / scrollView.bounds.size.width + 0.5)
    
        //Just to make sure we don't scroll past your content
        let clampedIndex = max( min( nearestIndex, yourPagesArray.count - 1 ), 0 )
    
        //This is the actual x position in the scroll view
        var xOffset = CGFloat(clampedIndex) * scrollView.bounds.size.width
    
        //I've found that scroll views will "stick" unless this is done
        xOffset = xOffset == 0.0 ? 1.0 : xOffset
    
        //Tell the scroll view to land on our page
        targetContentOffset.pointee.x = xOffset
    }
    

    You will also need to implement the following delegate method, to handle the case where the user lifts their finger gently without causing any scroll deceleration:

    (Update: you may not need to do this under the latest iOS SDK. It seems like the above delegate method is now called when there is zero velocity.)

    func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool)
    {
        if !decelerate
        {
            let currentIndex = floor(scrollView.contentOffset.x / scrollView.bounds.size.width)
    
            let offset = CGPoint(x: scrollView.bounds.size.width * currentIndex, y: 0)
    
            scrollView.setContentOffset(offset, animated: true)
        }
    }
    

    Objective-C

    Setting your deceleration rate:

    scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
    

    Then your scroll view delegate implementation:

    - (void) scrollViewWillEndDragging:(UIScrollView *)scroll withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
    {
        //This is the index of the "page" that we will be landing at
        NSUInteger nearestIndex = (NSUInteger)(targetContentOffset->x / scrollView.bounds.size.width + 0.5f);   
    
        //Just to make sure we don't scroll past your content
        nearestIndex = MAX( MIN( nearestIndex, yourPagesArray.count - 1 ), 0 );
    
        //This is the actual x position in the scroll view
        CGFloat xOffset = nearestIndex * scrollView.bounds.size.width;
    
        //I've found that scroll views will "stick" unless this is done
        xOffset = xOffset==0?1:xOffset;
    
        //Tell the scroll view to land on our page
        *targetContentOffset = CGPointMake(xOffset, targetContentOffset->y);
    }
    
    - (void) scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
    {
        if( !decelerate )
        {
            NSUInteger currentIndex = (NSUInteger)(scrollView.contentOffset.x / scrollView.bounds.size.width);
    
            [scrollView setContentOffset:CGPointMake(scrollView.bounds.size.width * currentIndex, 0) animated:YES];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change UIScrollview scroll indicator's style. I have turned paging on and
I would like to reproduce UIScrollView's flick-to-scroll behavior, but I don't want to use
Guys! So, I have an UIScrollView. In this Scroll View, I want to have
I want to implement a paging UIScrollView that will scroll in both directions (vertically,
I have created sample circular UIScrollview.it works fine.but i want to scroll through NSTimer
I have implemented a paging UIScrollView following this excellent tutorial: http://www.iosdevnotes.com/2011/03/uiscrollview-paging/ The UIScrollView works
I have a UIScrollView and I want it to be able to scroll in
I want an idea to scroll a UIScrollView without user inputs. how to do
I have a UIScrollView and want to set a timer, so if I scroll
I don't want the UIScrollView to scroll. But only move when I drag it.

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.