PDA

View Full Version : UISlider Tracks Not Detecting touchesBegan, But Will Detect touchesMoved




Darkroom
Jul 1, 2009, 03:52 AM
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?



Darkroom
Jul 1, 2009, 04:25 AM
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:


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

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
firstTouchPoint = CGPointZero;