AASignatureView是一个UIView,通过在iOS中轻松地在屏幕上绘制来捕获数字签名,用Swift编写。
AASignatureView is a simple UIView to capture digital signature by drawing it on screen easily in iOS, written in Swift. It is a customised storyboard based UIView class that allows to capture digital signature easily without writing code.
To run the example project, clone the repo, and run pod install
from the Example directory first.
AASignatureView
can be installed using CocoaPods, Carthage, or manually.
AASignatureView
is available through CocoaPods. To install CocoaPods, run:
$ gem install cocoapods
Then create a Podfile with the following contents:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'AASignatureView'
end
Finally, run the following command to install it:
$ pod install
To install Carthage, run (using Homebrew):
$ brew update
$ brew install carthage
Then add the following line to your Cartfile:
github "EngrAhsanAli/AASignatureView" "master"
Then import the library in all files where you use it:
import AASignatureView
If you prefer not to use either of the above mentioned dependency managers, you can integrate AASignatureView
into your project manually by adding the files contained in the Classes folder to your project.
Drag UIView
object from the Object Library into your UIViewController
in storyboard.
Set the view’s class to AASignatureView
in the Identity Inspector.
Make sure the module property is also set to AASignatureView
.
You can customise the rating bar appearance in the Attributes Inspector.
Note: If storyboard does not show the stars click Refresh All Views from the Editor menu.
You can capture the signature view as UIImage .
if let image = signatureView.signature {
// captured image of signature view
}
You can check if signature view is empty or not using simple property
signatureView.isEmpty
.
You can clear the signature view by calling clear()
function.
signatureView.clear()
AASignatureView
is available under the MIT license. See the LICENSE file for more info.
Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.
I would love to know if you are using AASignatureView
in your app, send an email to Engr. Ahsan Ali