---
title: "activityDidFinish(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiactivity/activitydidfinish(_:)"
---

# activityDidFinish(_:)

Notifies the system that your activity object has completed its work.

## Declaration

```swift
func activityDidFinish(_ completed: Bool)
```

## Parameters

- `completed`: Specify doc://com.apple.documentation/documentation/Swift/true if the service executed to completion or doc://com.apple.documentation/documentation/Swift/false if the service was canceled or didn’t finish because of an error.

## Discussion

Discussion This method dismisses the sharing interface provided by the UIActivityViewController object. If you provided a view controller using the activityViewController method, this method dismisses that view controller too. You must call this method after completing the work associated with this object’s service. This is true regardless of whether you used the activityViewController or perform() method to initiate the service. When calling the method, use the Boolean value to indicate whether the service completed successfully. This method must be called on the main thread.

## See Also

### Performing the activity

- [canPerform(withActivityItems:)](uikit/uiactivity/canperform(withactivityitems:).md)
- [prepare(withActivityItems:)](uikit/uiactivity/prepare(withactivityitems:).md)
- [activityViewController](uikit/uiactivity/activityviewcontroller.md)
- [perform()](uikit/uiactivity/perform().md)
