我想通过在屏幕上移动手指来在屏幕上绘图。
我们如何在 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 绘图方法来绘制自定义绘图。本教程将引导您完成这些步骤。