---
title: "iOS PDF form events and notifications"
canonical_url: "https://www.nutrient.io/guides/ios/events-and-notifications/forms/"
md_url: "https://www.nutrient.io/guides/ios/events-and-notifications/forms.md"
last_updated: "2026-05-26T07:56:07.451Z"
description: "Discover how to manage PDF form events and notifications effectively in your iOS applications with our comprehensive guide."
---

# iOS PDF form updates and notifications guide

Form elements are based on annotations, so you can use `Notification.Name.PSPDFAnnotationChanged` to listen for user input in forms:

### SWIFT

```swift

// Start listening to the change notifications from all annotations.
NotificationCenter.default.addObserver(self, selector: #selector(annotationChanged(_:)), name:.PSPDFAnnotationChanged, object: nil)

@objc func annotationChanged(_ notification: Notification) {
    // Make sure it was a text field that changed.
    guard let annotation = notification.object as? TextFieldFormElement else {
        return
    }
    // Make sure that the annotation is in the currently handled document.
    guard annotation.document === self.document else {
        return
    }
    // Make sure that the contents, and not the style, changed.
    guard let keyPaths = notification.userInfo?[PSPDFAnnotationChangedNotificationKeyPathKey] as? [String], keyPaths.contains(#keyPath(Annotation.contents)) else {

        return
    }
    // Handle the change.
    print("Text field content changed: \(annotation.contents!)")
}

```

### OBJECTIVE-C

```objc

// Start listening to the change notifications from all annotations.
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(annotationChanged:) name:PSPDFAnnotationChangedNotification object:nil];

- (void)annotationChanged:(NSNotification *)notification {
    // Extract the notification content for further use.
    PSPDFAnnotation *annotation = (PSPDFAnnotation *)notification.object;
    NSArray<NSString *> *keyPaths = notification.userInfo[PSPDFAnnotationChangedNotificationKeyPathKey];
    // Make sure it was a text field that changed.
    if (![notification.object isKindOfClass:PSPDFTextFieldFormElement.class]) {
        return;
    }
    // Make double sure that the annotation is in the currently handled document.
    // Direct pointer comparison used on purpose.
    if (annotation.document!= self.document) {
        return;
    }
    // Make sure that the contents, and not the style, changed.
    if (![keyPaths containsObject:@"contents"]) {
        return;
    }
    // Handle the change.
    NSLog(@"Text field content changed: %@", annotation.contents);
}

```

The technique above can also be used to listen for changes in other types of form fields.

---

## Related pages

- [Analytics](/guides/ios/features/analytics.md)
- [Analytics events](/guides/ios/events-and-notifications/events.md)
- [iOS PDF annotation events and notifications](/guides/ios/events-and-notifications/annotation.md)
- [Events and notifications](/guides/ios/events-and-notifications.md)
- [Text selection events and notifications](/guides/ios/events-and-notifications/text-selection.md)

