<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWConnection/betterPathUpdateHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network12NWConnectionC23betterPathUpdateHandlerySbcSgvp"
  },
  "title" : "betterPathUpdateHandler"
}
-->

# betterPathUpdateHandler

A handler that receives updates when an alternative network path is preferred over the current path.

```
@preconcurrency final var betterPathUpdateHandler: (@Sendable (Bool) -> Void)? { get set }
```

## Discussion

Better path events are an indication that a more preferable network path is available. If you can migrate your work to a new connection, try establishing a new connection. Once that new connection is ready, cancel the original connection.

---

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)