Wednesday, November 14, 2012

Drag UIImageVIew ( touch Event ) in iphone


Drag UIImageVIew ( touch Event ) in iphone

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
blockView.center = location;   // blockView = UIimageView which you want to drag
}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[self touchesBegan:touches withEvent:event];
}

No comments:

Post a Comment