Skip to content

aaronbrethorst/SignatureView

 
 

Repository files navigation

Check out the sample project branch for a usage example.

One example of how to implement the SignatureViewController and its signature view in your own viewControllers:

//
// self.signature is a UIView reference to an IBOutlet (from xib),
// that is the placeholder for the signature view to be placed into
//
// self.signatureViewController will be instantiated in your -viewDidLoad method.
//
// NOTE: You must add the OpenGLES.framework and QuartzCore.framework to the project

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.signatureController = [[[SignatureViewController alloc] initWithNibName:@"SignatureView" bundle:nil] autorelease];
    self.signatureController.delegate = self;

    self.signatureController.view.frame = self.signatureView.frame;
    [self.view insertSubview:self.signatureController.view belowSubview:self.signatureView];
    [self.signatureView removeFromSuperview];
    self.signatureView = self.signatureController.view;

}

#pragma mark SignatureViewController delegate method

- (void) signatureViewController:(SignatureViewController *)viewController didSign:(NSData *)signature;
{
    NSData *thisSignature = signature;
    //
    // Do something with thisSignature, like save it to a file or a database as binary data.
    //
}

About

A simple signature view that presents a signature box and returns a finger drawn signature (PNG format) as NSData

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%