Giter VIP home page Giter VIP logo

swiftsignatureview's Introduction

SwiftSignatureView (Swift 5.0)

Version License Platform

Description

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.

Sample

Version 2.2.2 | Swift 5.0

  • Modified the swiftSignatureViewDidPanInside delegate method to include the pan gesture recognizer in the callback. Warning: This will change the interface!

Version 2.2.0 | Swift 5.0

  • Added a getCroppedSignature method to get a UIImage of the signature with surrounding whitespace trimmed
  • Made the signature image publicly settable
  • Modified the example to demonstrate the cropped signature function

[ A big thank you to all the contributors. I know I don't say it enough. ]

Version 2.1.0 | Swift 5.0

  • Updated the Pod to Swift 5.0 syntax. The interface remains unchanged.

Version 2.0 | Swift 3.0 / XCode 8

  • Upgraded the Pod to Swift 3.0 syntax. The interface remains unchanged.

Version 1.0.3 | Swift 2.3 / XCode 8 compatibility

  • Upgraded the Example to use XCode 8 Storyboards. The SwiftSignatureView class file, however, remains unchanged when 'upgraded' to Swift 2.3.

Version 1.0.2 | Callbacks for panning/tapping

  • Added delegate for callbacks on panning/tapping.

Version 1.0.1 | Bug fixes and Syntax updates to Swift 2.2

  • 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 | Bug fixes

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.

Usage

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 can use

signatureView.signature()

to get a UIImage representation of the signature;

signatureView.getCroppedSignature()

to get a UIImage representation of the cropped signature with the surrounding whitespace trimmed.

signatureView.clear()

to clear the signature view.

Installation

SwiftSignatureView is available through CocoaPods. To install it, simply add the following lines to your Podfile:

For Cocoapods >= 1.0

use_frameworks!
target "YOUR_PROJECT_NAME" do
    pod "SwiftSignatureView"
end

For Cocoapods < 1.0

use_frameworks!
pod "SwiftSignatureView"

Author

Alankar Misra, [email protected]

License

SwiftSignatureView is available under the MIT license. See the LICENSE file for more info.

swiftsignatureview's People

Contributors

alankarmisra avatar chrisgrant avatar erickuck avatar paweldudek avatar readmecritic avatar scottcc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.