How to draw signature with lines on iPhone screen?

点点圈 提交于 2019-12-03 21:08:13

As per the UIResponder Class Reference, you will also need to implement
– touchesBegan:withEvent: and
– touchesEnded:withEvent:.
After you implement these methods, you should be able to get enough data to implement a pathing bezier curve or other suitable solution.

[edit] A perhaps better solution would to be to obtain the touches directly from the UIEvent object once your controller receives a
– touchesMoved:withEvent: notification. Also, the GLPaint sample code may also prove helpful.

As the GLPaint sample code may be too complicated for beginners, I find this tutorial. It is simple to learn for most beginners.

Adam Davis

Keep in mind that a signature written with one's finger is going to be different than one written with a writing instrument. You may want to re-think what you're using the signature for, and whether it's as binding as you need it to be.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!