Bug or Feature? UISlider and Touch Methods

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

  1. Darkroom Guest


    Dec 15, 2006
    Montréal, Canada
    during development of my app i ran into problem and i'm not sure if it's a bug or not.

    basically i've reserved the right for the entire view to detect touches, and store the CGPoint of the first touch, that would allow for proper resizing of an object with a drag. on the screen there is a UISlider that wouldn't detect a first touch point if the point was on the tracks of the slider (not the slider's thumb to actually use the slider). i thought this was fine, no problem, until i realized that eventhough the slider's tracks didn't allow for touchesBegan method, they did allow for touchesMoved and touchesEnded! this causes major problems with my app, as a first touch point was required for the touchesMoved or touchesEnded methods to work properly, otherwise some very strange things happened.

    in the end i was able to code the touchesMoved and touchesEnded methods to only work if there actually did exist a first touch point (which, by the way, clears itself on touchesEnded).

    so why does the UISlider tracks detect touchesMoved and touchesEnded but not touchesBegan? attached is a demo app so you can see for yourself.

    Attached Files:

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Sounds like a bug to me. I'd say go ahead and submit that to Apple.

Share This Page