Option

public struct Option : Sendable

A struct representing an option.

Parameters

label

The label of the option.

value

The value of the option.

  • Declaration

    Swift

    public let label: String
  • Declaration

    Swift

    public let value: String
  • Initializes an Option struct with the given label and value.

    Declaration

    Swift

    public init(label: String, value: String)
  • Parses the input dictionary to return a list of options.

    Declaration

    Swift

    public static func parseOptions(from input: [String : Any]) -> [Option]

    Parameters

    input

    A dictionary simulating the JSON object.

    Return Value

    An array of Option structs.