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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:08:01+00:00 2026-06-05T07:08:01+00:00

I have made a UISlider work just like the slide to unlock slider. What

  • 0

I have made a UISlider work just like the “slide to unlock” slider.
What I need to do is determine the point at which lifting your finger off is classed as touchUpOUTSIDE and not touchUpINSIDE. This is the point where you slide your finger past the end of the slider too far.
I guess it’s the same as with a UIButton, you can press the button then slide your finger off the button and depending how far you go, it can still be classed as touchUpInside.
If possible, i’d like to mark the target area with a circle.

Once i’ve managed to find where this point is, is it possible to change it? So I could have a bigger target area?

I really don’t know where to start with this. 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-05T07:08:02+00:00Added an answer on June 5, 2026 at 7:08 am

    It’s taken me a few hours, but i’ve managed to sort this.
    I’ve done a lot of testing overriding touchesMoved, touchesEnded and sendAction:action:target:event and it seems that any touch within 70px of the frame classes as a touch INSIDE. So for a UISlider that’s 292×52 any touch from x:-70 to x:362 or y:-70 to 122 will count as an inside touch, even though it’s outside the frame.

    I have come up with this code that will override a custom class to allow a bigger area of 100px around the frame to count as an inside touch:

    #import "UICustomSlider.h"
    
    @implementation UICustomSlider {
        BOOL callTouchInside;
    }
    
    -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    {
        callTouchInside = NO;
        [super touchesMoved:touches withEvent:event];
    }
    
    -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    {
        CGPoint touchLocation = [[touches anyObject] locationInView:self];
        if (touchLocation.x > -100 && touchLocation.x < self.bounds.size.width +100 && touchLocation.y > -100 && touchLocation.y < self.bounds.size.height +100) callTouchInside = YES;
    
        [super touchesEnded:touches withEvent:event];
    }
    
    -(void)sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event
    {
        if (action == @selector(sliderTouchOutside)) {                          // This is the selector used for UIControlEventTouchUpOutside
            if (callTouchInside == YES) {
                NSLog(@"Overriding an outside touch to be an inside touch");
                [self sendAction:@selector(UnLockIt) to:target forEvent:event]; // This is the selector used for UIControlEventTouchUpInside
            } else {
                [super sendAction:action to:target forEvent:event];
            }
        } else {
            [super sendAction:action to:target forEvent:event];
        }
    }
    

    With a little bit more tweaking I should be able to use it for the opposite also. (Using a closer touch as an outside touch).

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

Sidebar

Related Questions

I have made an iphone application like flip cards in which values of cards
I have made this controller, which should be used to send emails. I need
I have made my own exception class which derives from runtime_error and is getting
I have a UISlider with a customized appearance (via setThumbImage, etc.). At some point
I have made a script to intimate the admin the list of module need
I have made one file say a.php. Now I want some thing like if
I have made an application in which there is a file main.c which uses
I have made the following method which runs hard-coded xPath queries in a hard-coded
I have made a binary executable file disassembled using disassembler like IDA Pro. Now,
I have made some c code for a program, which does some psycho-acoustics on

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.