TKUICustomization
public class TKUICustomization
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 TKUICustomization.shared
, which should
be done before displaying any view controllers or cards.
-
The shared customisation singleton. Update its properties and the customisation will then be reflected in the different view controllers and cards.
Declaration
Swift
public static let shared: TKUICustomization
-
The style to use for any of TGCardViewController-based controllers
Declaration
Swift
public var cardStyle: TGCardStyle
-
How card actions of style
.normal
should be displayedDefaults to
.outline
Declaration
Swift
public var cardActionNormalStyle: TKUICardActionNormalStyle
-
Called whenever a view controller or card is displaying a new object, which can be used to attaching debugging information to bug reports.
Declaration
Swift
public var feedbackActiveItemHandler: ((Any) -> Void)?
-
Called whenever a view controller or card encounteres an error that it cannot handle itself.
Declaration
Swift
public var alertHandler: ((Error, UIViewController) -> Void)
-
You can use this to force a compact layout for card actions
By default, if there are fewer than two actions provided through a card’s action factory, an extended layout (i.e., icon andd label are stacked horizontally) is used. If there are more than two actions then a compact layout (i.e., icon and labels are stacked vertically) is used.
Declaration
Swift
public var forceCompactActionsLayout: Bool
-
Set this to
true
to show both image and title for card actions.The default value is
false
, which means an action is showing only the image.Note
If setting this totrue
, it’s best to ensure the title is is short, otherise, text may get truncated.Declaration
Swift
public var showCardActionTitle: Bool
-
Set this to true if the services’ transit icons should get the colour of the respective line.
Default to
false
.Declaration
Swift
public var colorCodeTransitIcons: Bool
-
Provide a tap handler here to add an (i) accessory button next to autocompletion results, that otherwise don’t get an accessory button.
This handler is called when that button is tapped.
Declaration
Swift
public var locationInfoTapHandler: ((TKUILocationInfo) -> TKUILocationHandlerAction)?