Section

public struct Section : OptionSet

Describes atomic sections of the item for visibility.

  • The icon section indicating the transport mode of the route.

    Declaration

    Swift

    public static let icon: RouteDescriptionItem.Section
  • The duration section indicating the duration of the route.

    Declaration

    Swift

    public static let duration: RouteDescriptionItem.Section
  • The delay section indicating the traffic delay along the route.

    Declaration

    Swift

    public static let delay: RouteDescriptionItem.Section
  • bar

    The bar section visually indicating the length of the route.

    Declaration

    Swift

    public static let bar: RouteDescriptionItem.Section
  • The length section indicating the length of the route in meters.

    Declaration

    Swift

    public static let length: RouteDescriptionItem.Section
  • The time section indicating the arrival time of the route.

    Declaration

    Swift

    public static let time: RouteDescriptionItem.Section
  • all

    All available sections combined in one array.

    Declaration

    Swift

    public static let all: RouteDescriptionItem.Section
  • This variable returns the Section as a String. For example, Section(rawValue: 19) is stringized as icon|duration|length.

    Note

    The | character is used to concatanate the Section values.

    Note

    The returned string is all in lowercase.

    Note

    The order of the substrings follow the Section declaration order. For example [.length, .icon] is converted as icon|length.

    Declaration

    Swift

    public var stringized: String { get }
  • The corresponding value of the raw type.

    Declaration

    Swift

    public let rawValue: Int
  • This function converts a String which mimics the or'ed Section values like icon|duration|length to a Section like Section(rawValue: 19). Unknown strings are simply ignored.

    Note

    The | character should be used in the string to concatenate substrings.

    Note

    The function allows irregularities like blank chars before or after a | char or using capital characters.

    Declaration

    Swift

    public static func make(from string: String) -> Section

    Parameters

    string

    The string to be converted to a Section value.

    Return Value

    The Section value created out of the string. Note that it will be empty if the string does not have any Section-like substring.

  • Declaration

    Swift

    public init(rawValue: Int)