SignatureView

@IBDesignable
@objc(FWSignatureView)
@objcMembers
final public class SignatureView : UIView

Class: FWSignatureView

Accepts touches and draws an image to an UIView

Description

This is an UIView based class for capturing a signature drawn by a finger in iOS.

Usage

Add the FWSignatureDelegate to the view to exploit the optional delegate methods

  • startedDrawing(_ view: FWSignatureView)
  • finishedDrawing(_ view: FWSignatureView)
  • Add an @IBOutlet, and set its delegate to self
  • Clear the signature field by calling clear() to it
  • Retrieve the signature from the field by either calling
  • getSignature() or
  • getCroppedSignature() ## See https://github.com/GJNilsen/YPDrawSignatureView

Public properties

  • Undocumented

    Declaration

    Swift

    @IBInspectable
    public var strokeWidth: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    @IBInspectable
    public var strokeColor: UIColor { get set }
  • Undocumented

    Declaration

    Swift

    public var containsSignature: Bool { get }

Init

  • Undocumented

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)
  • Undocumented

    Declaration

    Swift

    override public init(frame: CGRect)

Draw

  • Undocumented

    Declaration

    Swift

    override public func draw(_ rect: CGRect)

Touch handling functions

  • Undocumented

    Declaration

    Swift

    override public func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    override public func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    override public func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    public override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool

Methods for interacting with Signature View

  • Undocumented

    Declaration

    Swift

    public func clear()
  • Undocumented

    Declaration

    Swift

    public func getSignature(scale: CGFloat = 1) -> UIImage?
  • Undocumented

    Declaration

    Swift

    public func getCroppedSignature(scale: CGFloat = 1) -> UIImage?
  • Undocumented

    Declaration

    Swift

    public func getPDFSignature() -> Data