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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:11:56+00:00 2026-05-30T18:11:56+00:00

I am using a UIScrollView with a list of buttons made to look much

  • 0

I am using a UIScrollView with a list of buttons made to look much like a UIPickerView. I have just implemented shake to shuffle, where upon detection of a shake I set the content offset of the UIScrollView to the position of the randomShuffle using the following.

[Singlescroll setContentOffset:CGPointMake(jumpX, jumpY+randShuffle*sepValue) animated:YES];

Instead of just moving the content offset to the random position that matches a button I would like to implement a shuffle animation where the view almost ‘spins’ like a slot machine and then ends up on the randomShuffle button position.

I tried to do this by simply animating the offset to the top of the UIScrollView then back down again before going back to the randomShuffle position (one after another), however this didn’t work and it just went straight to the randomShuffle position. I realise that I didn’t try this with a timer so the animations were not delayed however I would like to avoid running a timer if possible.

Is there any inbuilt animations that can handle this? and if not please can you suggest how I might approach this before using timers? thank you.

  • 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-30T18:11:58+00:00Added an answer on May 30, 2026 at 6:11 pm

    Instead of just using animated:YES, did you try putting it into something like:

    [UIView animateWithDuration:.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
        [Singlescroll setContentOffset:maximumOffsetPoint]; //spin all the way up?
    }completion:^(BOOL finished){
        if (finished)
            //kick off another animation, to spin it back down:
            [UIView animateWithDuration:.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
                [Singlescroll setContentOffset:CGPointMake(jumpX, jumpY+randShuffle*sepValue)];
            }completion:nil];
        }
    }];
    

    I don’t know if this answers your question, but completion blocks are super handy and might be what you need. Within the completion block, the second animation will only get called at the end of the first animation.

    Also, there are several animateWithDuration: methods on UIView, but in my experience this one is more reliable for animating properties such as contentOffset and zoomToRect of scroll views.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a large list of views in a UIScrollView. I cannot use
I have a UIScrollView with pagingEnabled on and I want to (using like a
I have a UIView that I'm sliding in using a UIScrollView. Code looks like
I have successfully implemented a working UIScrollView layer on top of Cocos2d using this
I have added a UIScrollVIew using IB. Then using the following code i add
I have a UIScrollView which I create and size dynamically using... scrollView.contentSize = CGSizeMake(scrollView.frame.size.width
I have a subclass of UIScrollView that I'm using for images slideshow, with infinite
I have a UIScrollView that is displaying a list of data. Right now, when
I'm using an UIScrollView and I have an image that indicates to the user
In my app am using UIScrollView. I added buttons to UIScrollView. For each button

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.