---
title: fieldName()
framework: pdfkit
role: symbol
role_heading: Instance Method
path: pdfkit/pdfannotationtextwidget/fieldname()
---

# fieldName()

Returns the internal name for the annotation text field.

## Declaration

```swift
func fieldName() -> String!
```

## Return Value

Return Value The internal name for the annotation text field.

## Discussion

Discussion Field names are optional, internal names that identify text fields in a PDF form. You use field names with the PDFActionResetForm action. Note that multiple PDFAnnotationTextWidget objects with the same field name always have the same text associated with that field name. When text is entered into one of the objects, the text associated with that field name is changed in all objects. If you need to ensure unique text for a PDFAnnotationTextWidget object, you must give it a unique field name (you can use setFieldName(_:) to do this).

## See Also

### Related Documentation

- [PDFAnnotationTextWidget](pdfkit/pdfannotationtextwidget.md)

### Working with Field Names

- [setFieldName(_:)](pdfkit/pdfannotationtextwidget/setfieldname(_:).md)
