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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:59:27+00:00 2026-06-04T18:59:27+00:00

I have a set of sliders, I’m using Value Changed to feed a number

  • 0

I have a set of sliders, I’m using Value Changed to feed a number to a % indicator. I’m also using this value to check if the slider is below a certain point. If it is, I want to run a UIViewAnimation (which I am, it’s all working fine). However, the animation gets called constantly if the slider is moved below the threshold, meaning the items being animated go from point a to point b then back again over and over. So, can I trigger the animation once only at the threshold point?

This is how I get my value in pixels:

_sizeSliderRange = _sizeSlider.frame.size.width - _sizeSlider.currentThumbImage.size.width;
_sizeSliderOrigin = _sizeSlider.frame.origin.x + (_sizeSlider.currentThumbImage.size.width / 4.0);
_sizeSliderValueToPixels = (_sizeSlider.value * _sizeSliderRange) + _sizeSliderOrigin;

And I use a conditional inside the linked Value Changed IBAction function to checkt he value and do the work:

if (_sizeThumbX < 85) {  //if within 60px of the left margin we animate the label to sit float left
    [UIView transitionWithView:_sizeLabel duration:0.25f options:UIViewAnimationCurveEaseInOut animations:^(void) { etc etc

Thanks.

  • 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-04T18:59:29+00:00Added an answer on June 4, 2026 at 6:59 pm

    Like @Luis said, just use a BOOL property like this:

    if (_sizeThumbX < 85) {  //if within 60px of the left margin we animate the label to sit float left
        if (!self.passedBelowThreshold) {
            [UIView transitionWithView:_sizeLabel duration:0.25f options:UIViewAnimationCurveEaseInOut animations:^(void) { /* ... */ }
        }
    }
    self.passedBelowThreshold = _sizeThumbX < 85;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set my UISlider up to respond to value changed events: [customSlider addTarget:self
I have a set number of controls that are a value between 1 and
I have :set hlsearch as default value. When I search for something, search terms
We have set up a SharePoint meeting workspace (using WSS 3.0) for our weekly
Hopefully I can explain this clearly. I'm looking to have a two sliders, and
I am using jqueryui autocomplete and have set up a search of an image
Using the Slider Jquery plugin from Egor Khmelev, I've managed to set the slider
I have a set of 10 JQuery UI sliders that need to be tested
I need to set a dependency property on a control (Slider.Value) in my code
I have a feature slider set up that draws in posts that are tagged

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.