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

# GCStylus.DidConnectMessage

A message that posts after a stylus 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: GCStylus.self, for: .didCnnect) { message in
   let stylus = message.stylus
}
```

Connections of stylus accessories will be reflected in the
`styli` array of the `GCStylus` class when the message posts.

## Topics

### Initializers

[`init(stylus: GCStylus)`](/documentation/GameController/GCStylus/DidConnectMessage/init(stylus:))

### Instance Properties

[`var stylus: GCStylus`](/documentation/GameController/GCStylus/DidConnectMessage/stylus)

The stylus 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)