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

  • SEARCH
  • Home
  • 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 3424102
In Process

The Archive Base Latest Questions

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

I would like to make a wheel-style menu which allows the user to rotate

  • 0

I would like to make a wheel-style menu which allows the user to rotate the wheel (a UIImageView) to see various options. In the top half of the wheel there is also a selection indicator and the user can select a particular option by dragging the desired option around the wheel and position underneath the selection indicator (just like when using a UIPickerView).

Following the SO post iPhone – How to build a roulette like wheel? I have been able to implement a wheel which tracks user touches and rotates the wheel accordingly. However, I need two additional functions:

  1. Implement inertial scrolling so that the user can do a swipe on the wheel and it rotates around and gracefully slows down / decelerates, a bit like the wheel on the “Wheel of Fortune” game show.

  2. When the wheel does finish decelerating and comes to a complete stop it will automatically stop on one of the options, so that a single option appears underneath the selection indicator (like a UIPickerView), rather than potentially having two options both half under the selection indicator.

I am unsure how to go about implementing these features, so any assistance would be greatly appreciated.

  • 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-18T06:26:05+00:00Added an answer on May 18, 2026 at 6:26 am

    As a starting point, what you probably want to do is keep track of how much the user has been scrolling the wheel. When the user starts touching the wheel, save the date and current angle with

    NSDate *lastDate = [NSDate date];
    double lastAngle = //however you're determining the wheel angle
    

    Then on each touchMoved, update those values with the current time and angle. When you finally get to touchEnded, get the time interval since the last saved date and use that to determine the rotational speed of the wheel:

    NSDate *currentDate = [NSDate date];
    NSTimeInterval elapsedTime = [currentDate timeIntervalSinceDate];
    double rotationalSpeed = (currentAngle - lastAngle) / elapsedTime;
    

    Now you have the angle/second that the wheel is rotating under the user’s finger. The goal would be to keep up that same speed, so perhaps just starting a timer that fires every fraction of a second and rotates the wheel to rotationalSpeed * timeElapsedSinceLastTimerFired. Calculate the last by saving the actual date the timer fired method is called similar to how you tracked the time between wheel angle updates above. Alternately, you could have longer intervals between angle updates, and animate the rotation over time. When your short animation completes, you just start off another one.

    Those would keep the wheel turning at the user’s last speed indefinitely. To taper it off, you could just have a timer that fires every 0.1 seconds or something perhaps and decreases the rotationalSpeed until it is at or below zero. Even better, how about storing the date that the user let go of the wheel, and then just applying a portion of rotationalSpeed depending on how long it’s been since the user stopped interacting. Something like:

    CGFloat secondsUntilWheelShouldStop = 5;
    NSTimeInterval intervalSinceUserStopped = [[NSDate date] timeIntervalSinceDate:userStoppedDate];
    
    // Determine fraction of secondsUntilWheelShouldStop that's elapsed
    CGFloat portionOfCooldownTimeElapsed = intervalSinceUserStopped / secondsUntilWheelShouldStop;
    if (portionOfCooldownTimeElapsed >= 1.0) {
        // Time has run out, so call your method to round to nearest "snap-to" angle or something and end.
        [self snapWheelRotation];
    } else {
        // Rotate the wheel by the appropriate fraction of rotationalSpeed
        double angleToRotate = (portionOfCooldownTimeElapsed * rotationalSpeed) * elapsedTimeSinceLastUpdate;
        [self rotateWheelByAngle:angleToRotate];
    }
    

    When you stop the wheel, just determine what the nearest snap point is, and animate the wheel to that position. You should add something to touchesBegan that basically ends all of these timers and animation when the user touches the wheel as well so it doesn’t animate underneath them.

    I’m not sure if that’s the most elegant solution, but it’s where I would start if I were trying to solve the problem. Good luck!

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

Sidebar

Related Questions

I would like make an extension method for the generic class A which takes
I would like to make my Java/Swing application compatible with the Services-menu available on
Would like to make anapplication in Java that will not automatically parse parameters used
I would like to make a nightly cron job that fetches my stackoverflow page
I would like to make an ajax call to a different server (same domain
I would like to make a child class that has a method of the
I would like to make a list of remarkable robot simulation environments including advantages
I would like to make the update of the web application as automated as
I would like to make my application somewhat REST compliant. I am using Rails
I would like to make a simple web app that displays 20 or so

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.