<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponder/restoreUserActivityState(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIResponder(im)restoreUserActivityState:"
  },
  "title" : "restoreUserActivityState(_:)"
}
-->

# restoreUserActivityState(_:)

Restores the state needed to continue the given user activity.

```
func restoreUserActivityState(_ activity: NSUserActivity)
```

## Parameters

`activity`

The user activity to be continued.

## Discussion

Subclasses override this method to restore the responder’s state with the given user activity. The system calls it on any objects passed to the restoration handler given to [`application(_:continue:restorationHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:continue:restorationHandler:)). The override should use the state data contained in the given user activity’s `userInfo` dictionary to restore the object.

You may also call this method directly if the app delegate chooses not to use the restoration handler.

---

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)