如何在iPhone SDK中使用手势在屏幕上绘图?
答
您首先需要实现来自UIResponder链的触摸感应方法。你需要实现的方法有:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
在这个方法里面你可以使用Core Graphics绘图方法绘制自定义绘图。 This教程将引导您完成步骤。