I do not want any code but I need reference tutorial on how to draw a smooth line on iPhone through finger touch.
After drawing first line when user draws second line how can I find that second line intersects with the first line or not.
Thanks in advance....
Use the Notes app to draw a sketch or jot a handwritten note with your finger. You can choose from a variety of Markup tools and colors and draw straight lines with the ruler.
Tap and hold the text to select the line in which you wish to strike through. The in-context marking menu will appear. Drag either of the blue bookends to the left or right to narrow or widen your text selection. Tap the strikethrough S icon from the in-context marking menu.
Write words Open any app that you can type with, like Gmail or Keep. Tap where you can enter text. Slide your finger across the letters to spell the word you want. Then lift your finger.
I am using this:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
self.currentPath = [UIBezierPath bezierPath];
currentPath.lineWidth = 3.0;
[currentPath moveToPoint:[touch locationInView:self]];
[paths addObject:self.currentPath];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[self.currentPath addLineToPoint:[touch locationInView:self]];
[self setNeedsDisplay];
}
- (void)drawRect:(CGRect)rect {
[[UIColor redColor] set];
for (UIBezierPath *path in paths) {
[path stroke];
}
}
You can get related class reference from apple.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With