<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.12.0"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFAnnotationTextWidget/fieldName()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFAnnotationTextWidget(im)fieldName"
  },
  "title" : "fieldName()"
}
-->

# fieldName()

Returns the internal name for the annotation text field.

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

## Return Value

The internal name for the annotation text field.

## Discussion

Field names are optional, internal names that identify text fields in a PDF form. You use field names with the [`PDFActionResetForm`](/documentation/PDFKit/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(_:)`](/documentation/PDFKit/PDFAnnotationTextWidget/setFieldName(_:)) to do this).

## See Also

[`PDFAnnotationTextWidget`](/documentation/PDFKit/PDFAnnotationTextWidget)

A `PDFAnnotationTextWidget` object allows you to manage the appearance and content of text fields.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)