---
title: allowsExpensiveNetworkAccess
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessionconfiguration/allowsexpensivenetworkaccess
---

# allowsExpensiveNetworkAccess

A Boolean value that indicates whether connections may use a network interface that the system considers expensive.

## Declaration

```swift
var allowsExpensiveNetworkAccess: Bool { get set }
```

## Discussion

Discussion The system determines what constitutes “expensive” based on the nature of the network interface and other factors. iOS 13 considers most cellular networks and personal hotspots expensive. If there are no nonexpensive network interfaces available and the session’s allowsExpensiveNetworkAccess property is false, any task created from the session fails. In this case, the error provided when the task fails has a networkUnavailableReason property whose value is NSURLErrorNetworkUnavailableReasonExpensive. You can limit your app’s of use of expensive network access to user-initiated tasks, and put off discretionary tasks until a nonexpensive interface becomes available. To do this, set allowsExpensiveNetworkAccess (and allowsConstrainedNetworkAccess) to false and waitsForConnectivity to true. This way, your URLSessionTask waits for a suitable interface to become available before sending or receiving data. To test the behavior of this property, you can override the device’s current values for cellular and Wi-Fi cost in Settings > Developer > Network Override. tip: Prefer basing your app’s policy logic around the allowsConstrainedNetworkAccess property rather than this one. People using your app can use the “Low Data Mode” setting to set the constrained status, and thereby choose to use a potentially expensive network.

## See Also

### Supporting limited modes

- [allowsConstrainedNetworkAccess](foundation/urlsessionconfiguration/allowsconstrainednetworkaccess.md)
