---
title: "Create signature fields in PDFs on iOS"
canonical_url: "https://www.nutrient.io/guides/ios/signatures/add-a-signature-field/"
md_url: "https://www.nutrient.io/guides/ios/signatures/add-a-signature-field.md"
last_updated: "2026-06-23T10:35:39.104Z"
description: "Learn how to add signature fields to PDFs on iOS programmatically for electronic signing."
---

# Add signature fields to PDFs on iOS

Programmatically creating form fields can be useful when a PDF document needs to be electronically signed or digitally signed but doesn’t contain a signature field.

A document can still be digitally signed even when it doesn’t have a signature form element.

A form field is a model representation of a visual form in a document. To be able to create a signature form field, you have to first create a [`SignatureFormElement`](https://www.nutrient.io/api/ios/documentation/pspdfkit/signatureformelement) (a type of widget annotation). This works the same as adding any other annotation, as can be seen in our guide on [programmatically creating annotations](https://www.nutrient.io/guides/ios/annotations/programmatically-creating-annotations.md). For more information on the difference between a form field and a form element, see our guide on [forms](https://www.nutrient.io/guides/ios/forms/introduction-to-forms.md).

When the form element has been added to the document on the correct page, you can call [`insertedSignatureField(withFullyQualifiedName:documentProvider:formElement:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/signatureformfield/insertedsignaturefield(withfullyqualifiedname:documentprovider:formelement:)) on [`SignatureFormField`](https://www.nutrient.io/api/ios/documentation/pspdfkit/signatureformfield). Note that this can fail, and you’ll need to check that the return value isn’t `nil`:

### SWIFT

```swift

// Create a new signature form element.
let signatureFormElement = SignatureFormElement()
// Position it in the document.
signatureFormElement.boundingBox = CGRect(x: 100, y: 100, width: 100, height: 20)
// Add it to the third page.
signatureFormElement.pageIndex = 2

// Insert a form field for the form element.
let signatureFormField = try! SignatureFormField.insertedSignatureField(withFullyQualifiedName: "Digital Signature", documentProvider: documentProvider, formElement: signatureFormElement)

```

### OBJECTIVE-C

```objc

// Create a new signature form element.
PSPDFSignatureFormElement *signatureFormElement = [[PSPDFSignatureFormElement alloc] init];
// Position it in the document.
signatureFormElement.boundingBox = CGRectMake(100.f, 100.f, 100.f, 20.f);
// Add it to the third page.
signatureFormElement.pageIndex = 2;

// Insert a form field for the form element.
NSError *error;
PSPDFSignatureFormField *signatureFormField = [PSPDFSignatureFormField insertedSignatureFieldWithFullyQualifiedName:@"Digital Signature" documentProvider:documentProvider formElement:signatureFormElement error:&error];
if (!signatureFormField) {
    // Handle error.
}

```

When creating a form field just before digitally signing a document, call `try document.save()` before signing the document to ensure the inserted signature form field is correctly added to the document. Otherwise, the appearance of the signed form field could stay empty.
---

## Related pages

- [Fill and sign a PDF form on iOS](/guides/ios/signatures/fill-and-sign-forms.md)
- [iOS PDF signature library](/guides/ios/signatures.md)
- [Understanding electronic and digital signatures](/guides/ios/signatures/overview.md)

