<!--
{
  "availability" : [
    "iOS: 3.0.0 - 7.0.0",
    "iPadOS: 3.0.0 - 7.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKPeerPickerControllerDelegate/peerPickerControllerDidCancel(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKPeerPickerControllerDelegate(im)peerPickerControllerDidCancel:"
  },
  "title" : "peerPickerControllerDidCancel(_:)"
}
-->

# peerPickerControllerDidCancel(_:)

Tells the delegate that the user canceled the connection attempt.

```
optional func peerPickerControllerDidCancel(_ picker: GKPeerPickerController)
```

## Parameters

`picker`

The controller for the peer picker dialog.

## Discussion

After this method returns, the controller dismisses the picker interface.

> Important:
> Although optional in the protocol, Game Kit expects your application to implement this method.

---

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)