Injectable components

Customise functionality and appearance

Elements of the UISDK can be injected to greater customise functionality and appearance.

Side Menu Handler

SideMenuHandler is an interface you can provide to handle routing from the side menu of the booking screen. The side menu is enabled or disabled if an implementation of SideMenuHandle is passed into the booking screen. If no handler is passed into the booking screen, the BookingScreen will be dismissable via an exit button in the top left.


final class KarhooSideMenuHandler: SideMenuHandler { 
	// create a class that conforms to SideMenuHandler

// set this class as the side menu handler, and the booking screen builder will do the rest
KarhooUI.set(sideMenuHandler: sideMenuHandler)


//supply a menu handler
KarhooUISDK.menuHandler = KHMenuHandler()



Implementing KarhooColors and setting it via KarhooUI.set(colors) in your AppDelegatewill override the default colours in the screens.

There is an Attributes file that generates a list of given attributes in XCode’s view editor, allowing developers to assign a set of pre-defined attributes to a target element on the view. This will be overridden if a KarhooUI.set(colors) is set in the AppDelegate.

final class KarhooColorImplementation: KarhooColors { 
	// create a class that provides getters for colours

	    var primaryDark: UIColor { 
	    	return .yellow

// set the colours implementation on launch (AppDelegate)
KarhooUI.set(colors: KarhooColorImplementation)


Key colours in the app can be overridden by placing these within your colors.xml file.