GithubHelp home page GithubHelp logo

epsignature's Introduction

EPSignature

EPSignature

Signature component for iOS written in Swift

Platform Swift 4.0 CI Status Version Carthage compatible License Twitter: @HaveYouMetPrabu

Preview

Screenshot Screenshot

Installation

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

pod "EPSignature"

To integrate EPSignature into your Xcode project using Carthage, specify it in your Cartfile:

github "ipraba/EPSignature"
Manual Installation

Just drag and drop the files in Pod/Classes folder into your project

Features

  1. User can draw the signature either by finger or by apple pencil
  2. Ability to save the signature as default signature which can be retrieved later
  3. Ability to load the saved signature
  4. Works on both orientations(portrait and landscape)
  5. Works on both iPhone and iPad devices
  6. Also can be embedded in any container view
  7. Can extract the signature as Image
  8. Draws smoothly

Initialization of EPSignatureViewController

let signatureVC = EPSignatureViewController(signatureDelegate: self, showsDate: true, showsSaveSignatureOption: true)
signatureVC.subtitleText = "I agree to the terms and conditions"
signatureVC.title = "John Doe"
let nav = UINavigationController(rootViewController: signatureVC)
presentViewController(nav, animated: true, completion: nil)

Note: You can also embed the signature view in any one of the container using the EPSignatureView

Properties of EPSignatureViewController

Properties Description
showsDate Bool value that allows to show the date while signing
showsSaveSignatureOption Bool value that allows the user to save the signature for future use
signatureDelegate Delegate listening for events
subtitleText Subtitle text for signature(Eg: Sign here)
tintColor Tint color for the view controller. Applies for barbuttons, switches and actionsheet

Properties of EPSignatureView

Properties Description
strokeColor Stroke color of the signature
strokeWidth Stroke width of the signature
isSigned Bool value checks whether the user has signed or not

EPSignatureViewController Delegates

func epSignature(_: EPSignature.EPSignatureViewController, didCancel error: NSError)
func epSignature(_: EPSignature.EPSignatureViewController, didSign signatureImage: UIImage, boundingRect: CGRect)

Note: boundingRect will contain the bounds of the signed image retrieved. Crop using this rect to make shorter and small signature images

License

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

Author

@ipraba

epsignature's People

Contributors

basthomas avatar cmanou avatar fraserscottmorrison avatar ipraba avatar lctwisk avatar readmecritic avatar sephora-private-mobile avatar splpeancovschi avatar valosip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

epsignature's Issues

Getting the signature strokes without the extra whitespace?

Currently there is a method that returns the bounds of the signature without the extra whitespace from the signature view. That is great, but why, then, did you not implement a method that would return the signature without the extra whitespace?

Needed . [dot] support

@ipraba, nice work! However, sometimes we need a dot with our signatures, currently, I am checking the Example in the Simulator, I can't add a dot. Please close this issue if it's working on the real device.

Thanks!

Swift 3.1 Support

Module compiled with Swift 3.0.2 cannot be imported in Swift 3.1: /$(PROJECT_DIR)/EPSignature.framework/Modules/EPSignature.swiftmodule/arm64.swiftmodule

I am having this error while trying to build the module with Carthage. I used the following command in the terminal.
carthage update --platform iOS --no-use-binaries

Please assist on this.

Not compatible for Carthage.

hi @ipraba

Not compatible for carthage in 1.0.6.

$ carthage update --platform iOS
*** Cloning EPSignature
*** Checking out EPSignature at "1.0.6"
*** xcodebuild output can be found in /var/folders/mj/5zhy3sh11h18pdwrb4v04b300000gn/T/carthage-xcodebuild.nt0zDe.log
*** Skipped building EPSignature due to the error:
Dependency "EPSignature" has no shared framework schemes for any of the platforms: iOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/ipraba/EPSignature/issues/new

Typo in delegate

This is a pedantic issue, a gramatically correct form for this:

optional func epSignature(_: EPSignatureViewController, didSigned signatureImage : UIImage, boundingRect: CGRect)

should be the following:

optional func epSignature(_: EPSignatureViewController, didSign signatureImage : UIImage, boundingRect: CGRect)

Multiple Signatures on one Screen

Hi,
I have a requirement of multiple signatures on one Screen using one VC. How can I differentiate delegate of each signature imageview? Is there some unique identifier like tag which I can use to identify which imageview should I update the sign in?

Swift 3.0 Support

Hi there,

will there be a swift 3.0 branch of your code in the near future?

Need to add image to draw on it

To do that I extended EPSignatureViewController. But the problem is that signatureView: EPSignatureView! is not public and therefore I can't add image to it as subview.

Cannot set image background

Hi, this is an awesome tool, thanks for that.

I tried to set a background image view(already done before) like this:

let backgroundImage = UIImage(named: imageName)
let backgroundView = UIImageView(image: backgroundImage)
backgroundView.frame = signatureViewController.view.frame       
signatureViewController.view.addSubview(backgroundView)
signatureViewController.view.sendSubviewToBack(backgroundView)

But it is just setted in a part of the screen.

Also could not make the navigation bar translucent


UINavigationController.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
UINavigationController.navigationBar.shadowImage = UIImage()
UINavigationController.view.backgroundColor      = UIColor.clearColor()
UINavigationController.navigationBar.translucent = true

The above code is tested in my whole app, but cannot make it work for this component

thanks in advance

Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1

Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1: /Users/Apple/Library/Developer/Xcode/DerivedData/Spectra-fcknpapvuhgrqbbpgiobxuogsadu/Build/Products/Debug-iphoneos/EPSignature.framework/Modules/EPSignature.swiftmodule/arm64.swiftmodule

I am having this error when compiling in xcode 8.1

App crashes after trying to save signature

I don't know what happened/ is happening but when I wanted to save my sign app crashed automatically. Other controls such as cancel, delete current signature and trying to save blank image are working.

Here's some screenshoots down below. Thanks

Screenshot 2021-10-18 at 23 03 15

Screenshot 2021-10-18 at 23 03 25

Xcode 10 Duplicate Controller issue

With xcode 10 it gives
unexpected duplicate task: CompileXIB
/--/--/Pods/EPSignature/Pod/Classes/EPSignatureViewController.xib (in target 'EPSignature')
also unable to find duplicate only in compile files.
Settings could be in Embedded pods framework. But unable to find it

Crop around signature

Is there any way to crop the UIImage around the signature? Right now I end up with a large UIImage that is mostly empty. Thanks

Confirming signature images contain signature strokes

I am using the epSignature delegate in the following:

let signatureVC = EPSignatureViewController(signatureDelegate: self)

if let signature = signatureView.getSignatureAsImage() {
    self.epSignature(signatureVC, didSign: signature, boundingRect: signatureView.getSignatureBoundsInCanvas())
}

I am checking for the existence of a signature before using it in the delegate. This works most of the time, and if my users do not attempt to sign then I can prevent the signature from being saved.

However I've seen blank signature images being saved lately. The user can simply tap on the signature view to generate the image, without ever drawing anything in the box. Is there a way to check the resulting image for strokes so I can prevent blank signature images from being saved?

Swift 4 Support

I'm using EPSignature 1.0.3 as a dependency of my private Cocoa Pod.
I've got several other dependencies in my pod spec file, all supporting Swift 4.
I cannot get my pod spec through lint validation if I include EPSignature as a dependency.

I'm getting the following errors when running pod spec lint command:
- ERROR | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:42:117: error: argument of '#selector' refers to instance method 'onTouchCancelButton()' that is not exposed to Objective-C - NOTE | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:103:10: note: add '@objc' to expose this instance method to Objective-C - ERROR | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:46:113: error: argument of '#selector' refers to instance method 'onTouchDoneButton()' that is not exposed to Objective-C - NOTE | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:108:10: note: add '@objc' to expose this instance method to Objective-C - ERROR | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:48:115: error: argument of '#selector' refers to instance method 'onTouchClearButton()' that is not exposed to Objective-C - NOTE | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:144:10: note: add '@objc' to expose this instance method to Objective-C - ERROR | [iOS] xcodebuild: EPSignature/Pod/Classes/EPSignatureViewController.swift:60:123: error: argument of '#selector' refers to instance method 'onTouchActionButton' that is not exposed to Objective-C

These errors are related to Swift 3 to Swift 4 conversion.
Is there any expected time for EPSignature to support Swift 4?

Thanks and congrats on your work

Limit signatureView draw space

Is there a way to change the size of the drawing space for the signature as a way to control the size of the signature drawn?

Problem with Xcode 9 - New build system

Hi, the library has a problem with the new build system:

Showing Recent Messages
๐Ÿ‘Ž unexpected duplicate task: CompileXIB ..../Pods/EPSignature/Pod/Classes/EPSignatureViewController.xib (in target 'EPSignature')

Orientation Issues

Hello and thanks for this library.
To replicate the issue i am facing to the following:
-> open app in portrait (device)
-> sign & accept & tap done
-> tap 'add my signature' again but now do that in landscape.
-> Load default signature
Now you will see that the image is not showing but if you tap Done it gets saved and it exits the view.

Also if you sign in portrait and then rotate in landscape the signature gets stretched.
If while stretched you try to sign again the signature returns to correct aspect ratio and but gets moved downwards.

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.