Options

@objc public class Options: NSObject

The Options class represents options for configuring the timeout and retry behavior of a network request.

  • The timeout length of the connection in seconds. Default value is 20.

    Declaration

    Swift

    public private(set) var connectionTimeoutLength: Int
  • The timeout length of the request in seconds. Default value is 60.

    Seealso

    URLRequest.timeoutInterval

    Declaration

    Swift

    public private(set) var timeoutLength: Int
  • The number of times a request should be retried if an error occurs. Default Value is 1.

    Declaration

    Swift

    public private(set) var numberOfRetries: Int
  • Initializes an Options object with default values.

    Declaration

    Swift

    public override init()
  • Initializes an Options object with the given values.

    Declaration

    Swift

    public init(connectionTimeoutLength: Int, timeoutLength: Int, numberOfRetries: Int)

    Parameters

    connectionTimeoutLength

    The connection timeout length.

    timeoutLength

    The request timeout length.

    numberOfRetries

    The number of times the request should be retried.