<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSUserActivityDelegate/userActivityWillSave(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSUserActivityDelegate(im)userActivityWillSave:"
  },
  "title" : "userActivityWillSave(_:)"
}
-->

# userActivityWillSave(_:)

Notifies the delegate that the user activity will be saved to be continued or persisted.

```
optional func userActivityWillSave(_ userActivity: NSUserActivity)
```

## Parameters

`userActivity`

The user activity to update.

## Discussion

The delegate overrides this method to update the activity with current state.

---

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)