---
title: "sharingViewController(_:didFinishWithError:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkgamesessionsharingviewcontrollerdelegate/sharingviewcontroller(_:didfinishwitherror:)"
---

# sharingViewController(_:didFinishWithError:)

Indicates the sharing view controller is ready to be dismissed.

## Declaration

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