You will notice that IDSCustomerJourneyController will do all the flow on it’s own. There might be cases, when the app would need to display some instruction between the steps, which could be easily implemented using the following steps:
- Create a UIViewController that you will want to be displayed. It must be a subclass of our own ViewController: IDSCustomerJourneyUIController
- Inside your controller you can implement any business logic you may require. MJCS only requires you to call 2 methods within the controller:
Swift
// When user has finished with all instructions and you want to proceed to the step itself
self.finish()
// or if you want to completely cancel the journey
self.cancel()
- Implement additional IDSCustomerJourneyControllerDelegate method and return your view controller:
Swift
func customerJourneyController(_ scanner: IDSCustomerJourneyController, intermediateUIForStep nextStep: IDSEnterpriseRequiredAction) -> IDSCustomerJourneyUIController?
- You may also want to display a screen when we upload data to the backend. In that case, you should return ViewController that is subclassed from IDSCustomerJourneyUIController and adheres to protocol IDSCustomerJourneyUIUploadingProtocol. Afterwards, you just need to implement additional delegate method and return the ViewController
func customerJourneyController(_ scanner: IDSCustomerJourneyController, intermediateUIForUploadingState currentStep: IDSEnterpriseRequiredAction) -> (IDSCustomerJourneyUIController & IDSCustomerJourneyUIUploadingProtocol)?