<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLError/networkUnavailableReason-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation8URLErrorV24networkUnavailableReasonAC07NetworkdE0OSgvp"
  },
  "title" : "networkUnavailableReason"
}
-->

# networkUnavailableReason

The reason the network was unavailable for a task.

```
var networkUnavailableReason: URLError.NetworkUnavailableReason? { get }
```

## Discussion

The network may be unavailable due to restrictions placed on the [`URLSessionConfiguration`](/documentation/Foundation/URLSessionConfiguration), such as [`allowsConstrainedNetworkAccess`](/documentation/Foundation/URLSessionConfiguration/allowsConstrainedNetworkAccess), [`allowsExpensiveNetworkAccess`](/documentation/Foundation/URLSessionConfiguration/allowsExpensiveNetworkAccess) and [`allowsCellularAccess`](/documentation/Foundation/URLSessionConfiguration/allowsCellularAccess).

If the error doesn’t involve network unavailability, this property is `nil`.

---

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)