[![CI Status](http://img.shields.io/travis/Alankar Misra/SwiftSignatureView.svg?style=flat)](https://travis-ci.org/Alankar Misra/SwiftSignatureView)
SwiftSignatureView is a lightweight, fast and customizable option for capturing signatures within your app. You can retrieve the signature as a UIImage. With code that varies the pen width based on the speed of the finger movement, the view generates fluid, natural looking signatures.
- Upgraded the Pod to 4.0 syntax / XCode 9. The interface remains unchanged.
- Upgraded the Pod to Swift 3.0 syntax. The interface remains unchanged.
- Upgraded the Example to use XCode 8 Storyboards. The SwiftSignatureView class file, however, remains unchanged when 'upgraded' to Swift 2.3.
- Added delegate for callbacks on panning/tapping.
- Fixes an issue where the signature might appear blurred on retina displays
- Updates the syntax to Swift 2.2
- Fixes pod spec to make it compatible with Cocoapods 1.0
Version 0.0.8 fixes a bug that caused SwiftSignatureView to compute incorrect offsets when not in full-screen mode. A big thank you to Todd Kersey for discovering the bug and suggesting a fix. This update fixes the issue.
To run the example project, clone the repo, and run pod install
from the Example directory first.
More specifically, you simply assign the SwiftSignatureView class to a UIView, optionally play with the minimum stroke width, maximum stroke width, stroke color and stroke alpha all which are settable from within the Interface Builder itself and you're all set! You can then use the signature property to get a UIImage representation of the signature and the clear method to clear the signature view. For example if you had:
@IBOutlet weak var signatureView: SwiftSignatureView!
you could use
signatureView.signature
to get a UIImage representation of the signature and
signatureView.clear()
to clear the signature view.
SwiftSignatureView is available through CocoaPods. To install it, simply add the following lines to your Podfile:
use_frameworks!
target "YOUR_PROJECT_NAME" do
pod "SwiftSignatureView"
end
use_frameworks!
pod "SwiftSignatureView"
Alankar Misra, [email protected]
SwiftSignatureView is available under the MIT license. See the LICENSE file for more info.