<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCMouse/DidConnectMessage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Game Controller",
      "GameController"
    ],
    "preciseIdentifier" : "s:So7GCMouseC14GameControllerE17DidConnectMessageV"
  },
  "title" : "GCMouse.DidConnectMessage"
}
-->

# GCMouse.DidConnectMessage

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

```
struct DidConnectMessage
```

## Overview

Use the `didConnect` identifier with `NotificationCenter` to listen for
this message.

```
let observation = NotificationCenter.default.addObserver(of: GCMouse.self, for: .didConnect) { message in
   let mouse = message.mouse
}
```

Connections of mouse accessories will be reflected in the `mice` array
of the `GCMouse` class when the message posts.

## Topics

### Initializers

[`init(mouse: GCMouse)`](/documentation/GameController/GCMouse/DidConnectMessage/init(mouse:))

### Instance Properties

[`var mouse: GCMouse`](/documentation/GameController/GCMouse/DidConnectMessage/mouse)

The mouse object that connected to the device.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`MainActorMessage`](/documentation/Foundation/NotificationCenter/MainActorMessage)

---

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)