Add a custom progress view

Out of date

You can add a customized progress bar to the web checkout screen. This shows your customers where they are in the checkout process.

To add a custom progress view, inject your own implementation of UIProgressView and ProgressViewDelegate into the WebCheckoutBuilder as follows:

import PoqWebCheckout
import PoqFoundation
import PoqPlatform
class ClientModule: PoqModule {
func didAddToPlatform() {
// Override platform's deeplink logic.
let navigator = NavigationHelper.sharedInstance
navigator.mapRoute(navigator.cartTransferURL, toDestination: { _ in
navigator.openController(ClientModule.createWebCheckoutViewController())
})
}
static func createWebCheckoutViewController() -> UIViewController {
let router = CheckoutRouter(navigator: NavigationHelper.sharedInstance)
let supportedLocations = [CheckoutLocationDomainModel(host: "poq-web-carttransferdemo.azurewebsites.net", port: nil), CheckoutLocationDomainModel(host: "poq-web-carttransferdemo-uat.azurewebsites.net", port: nil)]
let checkoutBridgeConfiguration = CheckoutBridgeConfiguration(supportedLocations: supportedLocations, checkoutPaymentConfiguration: nil)
let checkoutType: CheckoutWebViewType = .bridge(configuration: checkoutBridgeConfiguration)
let customProgressView = CustomProgressView(height: 20)
return WebCheckoutBuilder<PoqCheckoutState>(router: router, type: checkoutType)
.withProgressView(customProgressView)
.build()
}
}
class CustomProgressView: UIProgressView & ProgressViewDelegate {
var height: CGFloat
public init(height: CGFloat) {
self.height = height
super.init(frame: CGRect.zero)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func addProgressView(toView view: UIView) {
// Your custom implementation goes here.
}
}