UISlider Tracks Not Detecting touchesBegan, But Will Detect touchesMoved

Discussion in 'iOS Programming' started by Darkroom, Jul 1, 2009.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    i have an image that resizes based on the touches began and touches moved methods. in order for smooth resizing of the image, touchesBegan has to send it's touch location to touchesMoved.

    these touch methods can happen anywhere on the screen, which also hosts a UISlider. the problem is that the right and left tracks of the slider do not detect touchesBegan, but will detect touchesMoved.

    how can i either make the UISlider detect touchesBegan, or also ignore touchesMoved?
     
  2. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #2
    oh, there it is... the answer, once again, is discovered after i post for help.

    i simply ask if there is a CGPoint firstTouchPoint in the touchesMoved method, and then reset the firstTouchPoint on touchesEnded:

    Code:
    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    	{
    	if (firstTouchPoint.x != CGPointZero.x)
    ...
    
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    	{
    	firstTouchPoint = CGPointZero;
    
     

Share This Page