Notable Classes
-
An action that can be added to a
TKUI<*>Card
. An array of these actions is typically generated by a factory method in a card’s configuration property, e.g.,TKUITripOverviewCard.config.tripActionsFactory
orTKUIServiceCard.config.serviceActionsFactory
For a concerte example, see
TKUIStartTripAction
.If the action changes the state of the button itself, some care need to be taken that this is reflected:
See morefunc buildFavoriteAction(stop: TKUIStopAnnotation) -> TKUITimetableCard.Action { func isFavorite() -> Bool { FavoriteHelper.isFavorite(stop) } func title() -> String { isFavorite() ? "Remove" : "Add" } func icon() -> UIImage { isFavorite() ? UIImage.remove : UIImage.add } return TKUITimetableCard.Action( title: title, icon: icon ) { action, _, stop, _ in FavoriteHelper.toggleFavorite(stop) } }
Declaration
Swift
@MainActor open class TKUICardAction<Card, Model> : ObservableObject where Card : TGCard
-
This class let’s you customise various aspects of TripKitUI that apply across multiple view controllers or cards. You can do this by setting the various parts of
See moreTKUICustomization.shared
, which should be done before displaying any view controllers or cards.Declaration
Swift
public class TKUICustomization
-
The base class for map managers in TripKitUI
The following diagram illustrates the relationships:
See more┌────────────────────────────────────────────────────────────────────┐ │ TGCardViewController │ │ ┏━━━━━━━━━━━━━━━━━━━┓ ╔════════════════════════╗ │ │ ┃TGMapManager ┃─ ─ ─Implements ─ ▶║TGCompatibleMapManager ║ │ │ ┗━━━━━━━━━━━━━━━━━━━┛ ╚════════════════════════╝ │ └───────────▲────────────────────────────────────────────────────────┘ │ Subclass──────────────────┐ │ │ ┌───────────┼─────────────────────┼──────────────────────────────────┐ │ TripKitUI │ │ │ │ ┏━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━┓ │ │ ┃TKUIMapManager ┃ ┃TKUIComposingMap...┃ │ │ ┗━━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━━┛ │ │ ▲ │ │ Subclass──────────────────┬─────────────────────┐ │ │ │ │ │ │ │ ┏━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━┓ │ │ ┃TKUIServiceMapMa...┃ ┃TKUIRoutingResul...┃ ┃TKUITripMapManager ┃ │ │ ┗━━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━━┛ │ └────────────────────────────────────────────────────────────────────┘
Declaration
Swift
open class TKUIMapManager : TGMapManager