---
title: "Set PDF annotation author on iOS | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/annotations/annotation-author-name/"
md_url: "https://www.nutrient.io/guides/ios/annotations/annotation-author-name.md"
last_updated: "2026-05-21T11:22:21.601Z"
description: "Nutrient iOS SDK will ask for the author name before the first annotation is created."
---

# Setting annotation authors on iOS

Nutrient iOS SDK will ask for the author name before the first annotation is created.

This behavior can be disabled via setting [`shouldAskForAnnotationUsername`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration/shouldaskforannotationusername) to `false` in [`PDFConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration).

## Using the UsernameHelper API

You also make use of our [`UsernameHelper`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper) API to show an alert asking for the default annotation author name to be used. You can do so by making a call to [`UsernameHelper.ask(forDefaultAnnotationUsernameIfNeeded:completionBlock:)`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper/ask(fordefaultannotationusernameifneeded:completionblock:)). This requires a [`PDFViewController`] object as a method argument, which the method uses to display the alert:

### SWIFT

```swift

let controller: PDFViewController =... // Currently displaying `PDFViewController`....
UsernameHelper.ask(forDefaultAnnotationUsernameIfNeeded: controller) { enteredUsername in
  // Do something with the entered username.
}

```

### OBJECTIVE-C

```objc

PSPDFViewController *controller =... // Currently displaying `PSPDFViewController`....
[PSPDFUsernameHelper askForDefaultAnnotationUsernameIfNeeded:controller completionBlock:^(NSString *enteredUserName) {
  // Do something with the entered username.
}];

```

The entered username value is then stored in the [`UsernameHelper.defaultAnnotationUsername`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper/defaultannotationusername). This property uses `NSUserDefaults` for storage against the [`PSPDFDocumentDefaultAnnotationUsernameKey`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pspdfdocumentdefaultannotationusernamekey) key.

You can use the [`UsernameHelper.isDefaultAnnotationUserNameSet`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper/isdefaultannotationusernameset) API to check whether or not a username is already set.

The username alert is only shown if an existing [`UsernameHelper.defaultAnnotationUsername`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper/defaultannotationusername) isn’t set and the [`shouldAskForAnnotationUsername`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration/shouldaskforannotationusername) property of the [`PDFConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration) object used to create the [`PDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller) sent to the method isn’t `false`.

If you want to ask for the username regardless of a default name being set already, clear the [`UsernameHelper.defaultAnnotationUsername`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper/defaultannotationusername) value before calling the [`UsernameHelper`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/usernamehelper) API to ask for the user name.

## Document-specific author name

The author name set with the above method is used at a global level for all documents. Nutrient also allows you to change the author name specific to a document. To do so, simply update the [`defaultAnnotationUsername`](https://www.nutrient.io/api/ios/documentation/pspdfkit/document/defaultannotationusername) property of the [`Document`](https://www.nutrient.io/api/ios/documentation/pspdfkit/document) instance to your desired author name:

### SWIFT

```swift

let document =... // Your document.
document.defaultAnnotationUsername = "Document Specific Author Name"

```

### OBJECTIVE-C

```objc

PSPDFDocument *document =... // Your document.
document.defaultAnnotationUsername = "Document Specific Author Name";

```
---

## Related pages

- [Define annotation behavior with flags on iOS](/guides/ios/annotations/annotation-flags.md)
- [Annotations object model on iOS](/guides/ios/annotations/the-annotation-object-model.md)
- [How to embed files in PDF annotations on iOS](/guides/ios/annotations/create-edit-and-remove/attach-a-file.md)
- [Defining annotation blend modes on iOS](/guides/ios/annotations/annotation-blend-modes.md)
- [Detect changes to PDF annotations in iOS apps](/guides/ios/annotations/detecting-if-annotations-have-changed.md)
- [Drag-and-drop annotations on iOS](/guides/ios/annotations/create-edit-and-remove/drag-and-drop.md)
- [Disable PDF annotation editing for iOS users](/guides/ios/annotations/create-edit-and-remove/disable-editing.md)
- [Programmatically create PDF annotations on iOS](/guides/ios/annotations/programmatically-creating-annotations.md)
- [Image picker: Add image annotations to PDFs on iOS](/guides/ios/miscellaneous/image-picker.md)
- [Annotation state manager on iOS](/guides/ios/annotations/annotation-state-manager.md)
- [Z-index for annotation stacking order on iOS](/guides/ios/annotations/annotation-z-index.md)
- [Undo and redo annotations on iOS](/guides/ios/features/undo-redo.md)

