LaunchArgumentValue

public protocol LaunchArgumentValue

Represents single portion of data to be passed through launch argument.

Objects implementing LaunchArgumentValue are used by the LaunchArgumentWithSingleValue and LaunchArgumentWithMultipleValues.

AutoMate provides default implementation for RawRepresentable objects and Bool values (check BooleanLaunchArgumentValue).

Example:

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

    var key: String {
        return "Server"
    }
}
struct Number: LaunchArgumentValue {
    var value: String {
        return "\(number)"
    }
    let number: Int
}
  • value Default implementation

    String representation of the value.

    Default Implementation

    Default string representation for raw representable launch arguments.

    Declaration

    Swift

    var value: String { get }