<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/onContinueUserActivity(_:perform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE22onContinueUserActivity_7performQrSS_ySo06NSUserG0CctF"
  },
  "title" : "onContinueUserActivity(_:perform:)"
}
-->

# onContinueUserActivity(_:perform:)

Registers a handler to invoke in response to a user activity that your
app receives.

```
nonisolated func onContinueUserActivity(_ activityType: String, perform action: @escaping (NSUserActivity) -> ()) -> some View
```

## Parameters

`activityType`

The type of activity that the `action` closure
handles. Be sure that this string matches one of the values that
you list in the
<doc://com.apple.documentation/documentation/bundleresources/information_property_list/nsuseractivitytypes>
array in your app’s Information Property List.

`action`

A closure that SwiftUI calls when your app receives a user
activity of the specified type. The closure takes the activity as
an input parameter.

## Return Value

A view that handles incoming user activities.

## Discussion

Use this view modifier to receive
<doc://com.apple.documentation/documentation/Foundation/NSUserActivity>
instances in a particular scene within your app. The scene that SwiftUI
routes the incoming user activity to depends on the structure of your
app, what scenes are active, and other configuration. For more
information, see [`handlesExternalEvents(matching:)`](/documentation/SwiftUI/Scene/handlesExternalEvents(matching:)).

UI frameworks traditionally pass Universal Links to your app using a
user activity. However, SwiftUI passes a Universal Link to your app
directly as a URL. To receive a Universal Link, use the
[`onOpenURL(perform:)`](/documentation/SwiftUI/View/onOpenURL(perform:)) modifier instead.

---

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)