Views

Last Updated - Platform 19.0 - SDK 14.0

Cart View Controller
Cart View Controller

Domain

The domain layer acts as the frontend contract for feature frameworks containing fixed data models with customData for customisations. Domain objects presented by this feature include:

  • CartState
  • CartDomainModel (will be renamed to Cart)
  • CartItemDomainModel (will be renamed to CartItem)

Customisation

The CartBuilder sets the main view and viewDataMapper properties from Containers by default. These can be changed for a specific instance of the Cart using the withView and withViewDataMapper functions. However, it is more likely that you will want to use Containers to customise the Cart on a global basis.

To inject a custom view or dependency you should:

  1. Open your AppModule and go to the relevant setUp function.

For a view or dependency shared by other features go to the UDependencies function. Otherwise, for one specific to the Cart, go to the setUpCart function.

  1. Use the docs to identify the view or dependency in Containers and add this to the setUp function.
  2. Create your custom view or dependency in the closure body.
func setUpCart() {
Container.shared.views.cartView = {
// Return your custom CartView here.
}
}