drag object vertically

Posted by blacksheep on Stack Overflow See other posts from Stack Overflow or by blacksheep
Published on 2010-05-08T11:30:26Z Indexed on 2010/05/08 11:38 UTC
Read the original article Hit count: 195

Filed under:
|

i like to drag this object vertically instead of horizontally, which is doin it now:

  • (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if (CGRectContainsPoint(myObject.frame, location)){ CGPoint xLocation = CGPointMake(location.x, myObject.center.y); myObject.center = xLocation; } }

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about drag