<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCVirtualController/connect(replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCVirtualController(im)connectWithReplyHandler:"
  },
  "title" : "connect(replyHandler:)"
}
-->

# connect(replyHandler:)

Connects the virtual controller to the device and displays it on the screen.

```
func connect(replyHandler reply: (@Sendable ((any Error)?) -> Void)? = nil)
```

```
func connect() async throws
```

## Parameters

`reply`

A closure that the method calls upon completion with the following parameter:

- `error`: Describes an error if it occurs, or returns `nil` if the operation completes.

## Discussion

After you invoke this method, the framework calls any input handlers you set for the elements, or you can poll the elements for their values.

---

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)