Enumeration

URLError.NetworkUnavailableReason

An enumeration of reasons explaining why a task couldn’t satisfy networking constraints.

Declaration

enum NetworkUnavailableReason : Int

Overview

The network may be unavailable due to restrictions placed on the URLSessionConfiguration, such as allowsConstrainedNetworkAccess, allowsExpensiveNetworkAccess and allowsCellularAccess.

Topics

Creating a Reason

init?(rawValue: Int)

Creates a network unavailability reason from the given raw value.

Unavailability Reasons

case cellular

A reason that indicates network is unavailable because the interface is cellular and cellular network is disabled.

case constrained

A reason that indicates network is unavailable because the user enabled “Low Data Mode” in the Settings app.

case expensive

A reason that indicates network is unavailable because the system marked the interface as expensive.

Hashing

var hashValue: Int

The hash value.

func hash(into: inout Hasher)

Hashes the essential components of this value by feeding them into the given hasher.

Comparing Reasons

var rawValue: Int

The raw value of this network unavailability reason instance.

static func != (URLError.NetworkUnavailableReason, URLError.NetworkUnavailableReason) -> Bool

Returns a Boolean value indicating whether two values are not equal.

See Also

Error Details

var errorCode: Int

The error code within the domain.

var errorUserInfo: [String : Any]

The error’s user-info dictionary.

var localizedDescription: String

A string containing the localized description of the error.

var failingURL: URL?

The URL which caused a load to fail.

var failureURLPeerTrust: SecTrust?

The state of a failed SSL handshake.

var failureURLString: String?

The string for the URL which caused a load to fail.

var downloadTaskResumeData: Data?

An opaque data object used to resume a failed download task.

enum URLError.BackgroundTaskCancelledReason

An enumeration of reasons used to explain the cancellation of a background task.

var networkUnavailableReason: URLError.NetworkUnavailableReason?

The reason the network was unavailable for a task.