iosswiftviper-architecture

iOS Swift - run a specific VIPER module without navigating through all screens


I would like to play with a specific Viper Module in my project. Technically now when I need to open a specific UIViewController I need to go through some screens enter some data and etc and then in a 20 seconds I am there in that specific screen.

So it takes a lot of time to navigate somewhere when I just need for example to test some small things (like UI adjustment, changing some strings how they fit screen and etc).

Instead I would like to run the specific screen when I run my project.

For sure mocking and injection will help a lot in this case as I need to insatiate my Viper Module with some initial data. This is just a technical detail here.

I would like to know how can organise my project to run specific modules instead of running entire project.

Hardcoded solution like using app delegate by adding extra code which overwriting initial point it's just a temp solution and you need to clean app delegate when you finish.

I may be wrong but I think there is should be a specific target solution which can run different modules whether it will initial point like HomeViewController or a specific module with mock injection.


Solution

  • To set the ground-rules of this answer, https://TheSwiftDev.com/the-ultimate-viper-architecture-tutorial describes the most-normative original-school-of-thought variant of what VIPER is and what it is intended to accomplish as self-discipline. (Other derivative viewpoints have arisen in the past several years, but I'll use this original school of thought in this answer for all-the-wood-behind-1-arrow clarity & pedagogical reasons.)