Reply:
LZ can UIBezierPath this category.
Use specific words can do:
- (Void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event {
UITouch * touch = [touches anyObject];
self.currentPath = [UIBezierPath bezierPath];
currentPath.lineWidth = 10.0;
[CurrentPath moveToPoint: [touch locationInView: self]];
[Paths addObject: self.currentPath];
}
- (Void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event {
UITouch * touch = [touches anyObject];
[Self.currentPath addLineToPoint: [touch locationInView: self]];
[Self setNeedsDisplay];
}
- (Void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event {
UITouch * touch = [touches anyObject];
for (UIBezierPath * path in paths) {
[Path removeAllPoints];
}
Reply:
TouchEnd above method in the removeAllPoints, the landlord does not have to write. This is what I use to own.
Reply:
Thanks for the answer, UIBezierPath is how to instantiate it? And I want to see the contents of the next drawRect function, thank you.
Reply:
Saw [UIBezierPath bezierPath];
Reply:
Learning,
To the point of it,
No comments:
Post a Comment