Collectors

extension Collectors
  • Finds the event type from a list of collectors. This function iterates over the list of collectors and returns the value if the collector’s value is not empty.

    Declaration

    Swift

    public func eventType() -> String?

    Return Value

    The event type as a String if found, otherwise nil.

  • Represents a list of collectors as a JSON object for posting to the server. This function takes a list of collectors and represents it as a JSON object. It iterates over the list of collectors, adding each collector’s key and value to the JSON object if the collector’s value is not empty.

    Declaration

    Swift

    public func asJson() -> [String : Any]

    Return Value

    JSON object representing the list of collectors.