CleanModule is an Xcode file template for iOS that generates a Clean Architecture (VIP) module: ViewController, Interactor, Presenter, Router, Worker, and Models. It follows the Clean Swift (VIP) approach, inspired by Uncle Bob's Clean Architecture.
- Clone or download this repo and open a terminal in the repo directory.
- Run:
sudo swift install.swiftsudo is required because the script copies the template into Xcode’s system template directory (Developer/Library/Xcode/Templates/...). If the template is already installed, it will be replaced.
- In Xcode: File → New → File… (or ⌘N).
- Under iOS, choose Clean Architecture Module Template (or CleanModule).
- Enter the module name (e.g.
Login,Profile). - Optionally check Create With Storyboard to include a storyboard file.
- Click Next and save into your target group.
The template generates: *ViewController, *Interactor, *Presenter, *Router, *Worker, *Models, and optionally a storyboard.
Each module follows the VIP cycle: ViewController → Interactor → Presenter → ViewController; Worker and Router are used for side effects and navigation; Models hold request/response/view model types.
To navigate to another scene, implement in the Router: routeToSomewhere(segue:) (and optionally a programmatic variant), navigateToSomewhere(source:destination:), and passDataToSomewhere(source:destination:) to pass data from this scene’s DataStore to the next scene’s DataStore. Use the same segue identifier in the storyboard so prepare(for:sender:) can call the router.
This project is licensed under the MIT License — see the LICENSE file for details.

