在UIView上记录触摸

问题描述

我有一个应用程序,可以在其中绘制一些“幻灯片”来做笔记。我想要做的是“保存”这些注释,以便可以在其他时间查看它们。也许创建带有触摸跟踪信息的文件,然后可以在用户方便时“加载”该文件。 我在屏幕上绘制的代码如下:
UIGraphicsBeginImageContext(self.view.frame.size);
[imageView.image drawInRect:CGRectMake(0,self.view.frame.size.width,self.view.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(),kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(),5.0);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(),1.0,0.0,1.0);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(),lastPoint.x,lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(),currentPoint.x,currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
那么,如何修改此代码以允许触摸跟踪并保存到文件? 干杯, 担     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)