FCSignatureView
手写签名控件 这个存储库用于在iOS应用程序中使用数字签名视图。
此视图有两个按钮
- 重置 - 用于重置签名。
- 完成 - 用于获取可用于应用程序的签名图像。
安装可以通过CocoaPods完成
1. CocoaPods
pod 'FCSignatureView'
基本示例代码
public protocol RotationNamedtable {
var allowRotation: Bool { get set}
}
class FCSiganatrueViewController: UIViewController {
var appDelegate = UIApplication.shared.delegate as! RotationNamedtable
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
appDelegate.allowRotation = true
UIDevice.current.setValue(UIInterfaceOrientation.landscapeRight.rawValue, forKey: "orientation")
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
appDelegate.allowRotation = false
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
}
}
private func setSignatureView() {
let gestureView = FCSignatureView.init(frame: .zero, config: FCSignatureConfig.init()) { (image) in
self.signatureImage = image
}
self.gestureView = gestureView
self.view.addSubview(gestureView)
}