1 min read
Customise
Last Updated - Platform 22.0.0 - SDK 17.0.0From 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 theWishlistWidget
,CartWidget
andVariantSelector
. - The
PoqCatalogueClient
framework for the Product domain and data layers.
These frameworks have the following dependencies:
- The
PoqCartClient
framework for theCartWidget
domain and data layers. - The
PoqWishlistClient
framework for theWishlistWidget
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 'ProductDetailsViewController'.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() .analytics(middleware: .customProductDetailsAnalytics()) .middleware(.customFun()) }}