TKUITripModeByModePageBuilder

public protocol TKUITripModeByModePageBuilder
  • Declaration

    Swift

    func cards(for segment: TKSegment, mapManager: TKUITripMapManager) -> [(TGCard, TKUISegmentMode)]

    Parameters

    segment

    A segment to display in the mode-by-mode pager

    mapManager

    The mode-by-mode pager’s map manager

    Return Value

    The cards to use for the provided segment, can be empty

  • Each segment should have an identifier that changes whenever the card’s configuration changes for this segment. If you return a new identifier for the same segment, the mode-by-mode cards will be rebuilt.

    Declaration

    Swift

    func cardIdentifier(for segment: TKSegment) -> String?

    Parameters

    segment

    A segment to display in the mode-by-mode pager

    Return Value

    An identifier for the segment, should be non-nil if there’s a card for it

  • Gets called every second with counter incrementing each second.

    Declaration

    Swift

    func shouldUpdate(trip: Trip, counter: Int) -> Bool

    Return Value

    If the trip should be updated with real-time data

  • This provides a compatible mode by mode builder a chance to perform any clean up tasks before a mode by mode card is disposed.

    Declaration

    Swift

    func cleanUp(existingCards: [TGCard])

    Parameters

    cards

    An array of cards currently displayed in the mode by mode card