1 min read

Customise

Last Updated - Platform 22.0.0 - SDK 17.0.0

From v22 onwards most features require no code as they are automatically set up by the Coordinators that construct them. This page highlights the key customisation points for this feature.

Overview

The Product Details feature is made up of three key frameworks:

  • The PoqProductDetail framework for the Product Details UI presentation layer.
  • The PoqCatalogue framework for the common Product UI presentation layer including the WishlistWidget, CartWidget and VariantSelector.
  • The PoqCatalogueClient framework for the Product domain and data layers.

These frameworks have the following dependencies:

  • The PoqCartClient framework for the CartWidget domain and data layers.
  • The PoqWishlistClient framework for the WishlistWidget domain and data layers.

Container Dependencies

Containers can be used to replace most feature dependencies with one line of code. For the Product Details feature this should be done in the AppModule on didAddToPlatform in an organised function such as setUpProductDetails or setUpDependencies.

Customise the Coordinator

The Coordinator builds the ProductDetailsViewController using the ProductDetailsBuilder and can be easily replaced via Containers.

// You can omit the generic type to use the default 'ProductDetailsController'.
Container.shared.coordinators.productDetails.replace {
PoqProductDetailsCoordinator() {
// Customise the builder here.
ProductDetailsBuilder()
}
}
// Here is a more fully customised example.
Container.shared.coordinators.productDetails.replace {
PoqProductDetailsCoordinator<CustomProductDetailsViewController>() {
ProductDetailsBuilder()
.withAnalyticsMiddleware(.customProductDetailsAnalytics())
.withMiddleware(.customFun())
}
}

Next steps