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

# activityDidFinish(_:)

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

```
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

This method dismisses the sharing interface provided by the [`UIActivityViewController`](/documentation/UIKit/UIActivityViewController) object. If you provided a view controller using the [`activityViewController`](/documentation/UIKit/UIActivity/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`](/documentation/UIKit/UIActivity/activityViewController) or [`perform()`](/documentation/UIKit/UIActivity/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.

---

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)