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

# maximumLength()

Returns the maximum number of characters allowed in the annotation string.

```
func maximumLength() -> Int
```

## Return Value

The maximum number of characters allowed in the annotations string. A return value of `0` means that there is no specified maximum.

## 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)