<!--
{
  "availability" : [
    "tvOS: 10.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKGameSessionSharingViewControllerDelegate/sharingViewController(_:didFinishWithError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKGameSessionSharingViewControllerDelegate(im)sharingViewController:didFinishWithError:"
  },
  "title" : "sharingViewController(_:didFinishWithError:)"
}
-->

# sharingViewController(_:didFinishWithError:)

Indicates the sharing view controller is ready to be dismissed.

```
func sharingViewController(_ viewController: GKGameSessionSharingViewController, didFinishWithError error: (any Error)?)
```

## Parameters

`viewController`

The sharing view controller to be dismissed.

`error`

An optional GameKit error. This parameter is `nil` if the sharing view controller is successfully dismissed.

## Discussion

---

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)