Skip to main content

Add Custom view to your project

  1. Create a class that conforms to ChoicelyExternalViewControllerFactory protocol:
  2. Declare all your custom views usage inside it’s createViewController() method:
    Custom navigation URLs like "choicely://special/your_custom_url" can be set and configured in Choicely Studio.
    This is how you can create custom navigation URLs:
    How to use navigation iOS
  3. Set the custom url, click “Add Navigation” and save the changes by clicking “Update” button in the top right corner.
  4. Here is the example of fully configured ChoicelyExternalViewControllerFactory:
  5. Create an instance of YourCustomViewControllerFactory class and just before ChoicelySDK.initialize(...) assign it to ChoicelySDK.settings.externalViewControllerFactory:
    To learn more about other ChoicelySDK settings explore them in XCode with (⌥)+click.
  6. That’s it! You’re ready to use your custom views.
    You can mix Choicely content like Articles and Surveys with your own UI logic inside one custom view.