LaunchArgumentWithSingleValue

public protocol LaunchArgumentWithSingleValue : LaunchArgument

Protocol that should be implemented by types representing launch argument that accepts single argument value.

Example:

enum Server: String, LaunchArgumentWithSingleValue, LaunchArgumentValue {
    case testing, production

    var key: String {
        return "Server"
    }
}

Usage:

let app = XCUIApplication()
TestLauncher(options: [
    Server.testing
]).configure(app).launch()

Handling:

let serverAddress = UserDefaults.standard.string(forKey: "Server")
  • value Default implementation

    Value of the launch argument.

    Default Implementation

    Default formatted representation of the launch argument value.

    Declaration

    Swift

    var value: LaunchArgumentValue { get }
  • launchArguments Extension method

    Default formatted representation of the launch argument.

    Declaration

    Swift

    public var launchArguments: [String]? { get }