signoAPI iOS – STSignatureCaptureViewController class

The STSignatureCaptureViewController class is the most important component of the libSignoSignatureCapture library. This class can be used to display a dialog to capture a signature. The STSignatureCaptureViewController class currently supports only the value UIModalPresentationFullScreen for the modalPresentationStyle property. The class is part of libSignoPDFSigner as well as of libSignoSignatureCapture.

@interface STSignatureCaptureViewController : UIViewController

Usage:

STSignatureCaptureViewController
       *signoCaptureVC = [[STSignatureCaptureViewController alloc] init];
signoCaptureVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:signoCaptureVC animated:YES completion:nil];

or

STSignatureCaptureViewController
       *signoCaptureVC = [[STSignatureCaptureViewController alloc] init];
signoCaptureVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self.view addSubview:signoCaptureVC.view];

signCaptureDelegate property

This property can be used to set the instance that implements the STSignatureCaptureDelegate class and thus should be informed of events in the STSignatureCaptureViewController.

@property (weak, nonatomic) id signCaptureDelegate

Property

Description

id signCaptureDelegate

-

Return value

Description

-

-

Usage:

signoCaptureVC.signCaptureDelegate = self;

configureDialog:withCaptureConfig: method

This method can be used to position and configure the signature dialog. The configuration is ignored if the enableFullScreenCapture property of the STSignatureCaptureConfig class is set to YES.

-(void)configureDialog:(CGRect)frame withCaptureConfig: (STSignatureCaptureConfig*)captureConfig

Parameter

Description

(CGRect)frame

Position specification of the signature dialog.

(STSignatureCaptureConfig*)captureConfig

The STSignatureCaptureConfig object or nil.

Return value

Description

-

-

Usage:

STSignatureCaptureConfig *sigCapConfig = 
[[STSignatureCaptureConfig alloc] init];
sigCapConfig.displayText = @"Display Name";
sigCapConfig.font = [UIFont fontWithName:@"Helvetica" size:24];
sigCapConfig.textColor = [UIColor blackColor];
sigCapConfig.position = CGRectMake(30.0f, 30.0f, 200.0f, 30.0f);
sigCapConfig.signatureColor = [UIColor blueColor];

[signoCaptureVC configureDialog:CGRectMake(0, 0, 650, 500)
withCaptureConfig:sigCapConfig];

getSignatureImage:height:penColor:penWidth: method

This method returns the most recently captured signature as an image in PNG format.

-(NSData*)getSignatureImage:(CGFloat)width height:(CGFloat)height penColor:(UIColor*)penColor penWidth:(int)penWidth

Parameter

Description

(CGFloat)width

Maximum width of the image in pixels.

(CGFloat)height

Maximum height of the image in pixels.

(UIColor*)penColor

Colour of the signature line.

(int)penWidth

Width of the signature line in pixels.

Return value

Description

NSData*

The signature image as a byte array or nil.

Usage:

NSData* signatureImageData = [signoCaptureVC getSignatureImage:650 height:500 penColor:[UIColor blueColor] penWidth:5];

getSignData method

This method returns the most recently captured signature in SignData format.

-(NSData*)getSignData

Parameter

Description

-

-

Return value

Description

NSData*

The SignData as a byte array or nil.

Usage:

NSData* signData = [signoCaptureVC getSignData];

setLicenseKey: method

This method can be used to enable the libSignoSignatureCapture component and, in so doing, to remove the demo message. Please use the licence string that was given to you by your contact at signotec.

ℹ️ Please note: This method can only be used for licence keys in the old format. If you have a licence key in the new UUID format (XXXXXXXX–XXXX–XXXX–XXXX–XXXXXXXXXXXX), please use the STLicenceManager class.

+(void)setLicenseKey:(NSString*)key

Parameter

Description

(NSString*)key

Licence string

Return value

Description

-

-

Usage:

[STSignatureCaptureViewController setLicenseKey:@"1234"];