-
(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint p = [touch locationInView:self];
NSValue *v = [NSValue valueWithCGPoint:p]; //CGPoint
转为 对象
NSMutableArray *points = [allPoints lastObject];
[points addObject:v];
//驱动画笔(drawRect 方法)
[self setNeedsDisplay];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{}
@end
效果:
找软件资料,就到一览软件文库