[翻译] PJR Signature View

PJR Signature View

https://github.com/paritsohraval100/PJRSignatureDemo

It is a UIView subclass by which you can draw signature and you can also get an image of that signature in your applications. 

这是一个UIView的子类,你可以在这个view上面绘制内容,并将绘制的内容转换成一张图片。

Why it is useful to you and what is new in it ?

为什么对你有用,他有什么新意?

It is a well structured components , The demo contains Model View Controller design pattern,It is using beizer path for drawing signature which is very fast and you can also get image of your signature.

这是一个非常好的模块化组件,这个demo包好了MVC的设计模式,这个view使用的是贝塞尔曲线来绘制签名,速度非常快,你可以快速的获取到绘制出的图片。

What is new ? 有什么不一样的地方?

It is well structured. It follows MVC. It is well designed which contains signature label , so no need to use extra UI for "Sign here" label. You can directly use this componet to any of your applications. It is created in dynamic way so you can set it according to your view size.

它是模块化设计,遵循MVC设计模式。里面包含了一个signature label,你不需要额外的创建Sign here的标签。你可以直接在源码中修改。

It will definitely make your app much interesting with its animations.

这会让你的app变得很酷。

How to use 

如何使用

Import this files 引入这些文件到你的项目当中

PJRSignatureView.h , PJRSignatureView.m

  • Add it into your view controller like: 这么初始化

signatureView= [[PJRSignatureView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 300)]; [self.view addSubview:signatureView];

  • Clear drwaing by: 然后这么清除

[signatureView clearSignature];

  • Get signature Image by 你可以这么获取到图片

[signatureView getSignatureImage];

  • you can change signature Color By 你可以这么修改颜色

#define INITIAL_COLOR [UIColor redColor]; #define FINAL_COLOR [UIColor redColor];

原文地址:https://www.cnblogs.com/YouXianMing/p/4197051.html