---
title: stateRestorationActivity
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uiscenesession/staterestorationactivity
---

# stateRestorationActivity

An activity object you can use to restore the previous contents of your scene’s interface.

## Declaration

```swift
var stateRestorationActivity: NSUserActivity? { get set }
```

## Discussion

Discussion Before disconnecting a scene, the system asks your delegate for an NSUserActivity object containing state information for that scene. If you provide that object, the system puts a copy of it in this property. Use the information in the user activity object to restore the scene to its previous state. The system encrypts your app’s state restoration on disk. If the file is unavailable at scene-connection time, perhaps because the device is still locked, the initial value in this property is nil. When the data becomes available, the system updates the value accordingly.

## See Also

### Getting additional session information

- [userInfo](uikit/uiscenesession/userinfo.md)
