---
title: GCController.DidConnectMessage
framework: gamecontroller
role: symbol
role_heading: Structure
path: gamecontroller/gccontroller/didconnectmessage
---

# GCController.DidConnectMessage

A message that posts after a game controller accessory connects to the device.

## Declaration

```swift
struct DidConnectMessage
```

## Overview

Overview Use the .didConnect identifier with NotificationCenter to listen for this message. let observation = NotificationCenter.default.addObserver(of: GCController.self, for: .didConnect) { message in    let controller = message.controller } Connections of controller accessories will be reflected in the controllers array of the GCController class when the message posts.

## Topics

### Initializers

- [init(controller:)](gamecontroller/gccontroller/didconnectmessage/init(controller:).md)

### Instance Properties

- [controller](gamecontroller/gccontroller/didconnectmessage/controller.md)

## Relationships

### Conforms To

- [NotificationCenter.MainActorMessage](foundation/notificationcenter/mainactormessage.md)
- [SendableMetatype](swift/sendablemetatype.md)
