A customizable Xcode template to quickly generate clean VIPER architecture modules for SwiftUI-based projects, with a clear and organized folder structure.
- Automated Structure: Instantly generates VIPER components (
View,Interactor,Presenter,Entity,Router) in separate folders. - SwiftUI Preview: Includes built-in SwiftUI previews to streamline UI development.
- Clean Architecture: Implements VIPER to ensure a clear separation of concerns and maintainable codebase.
YourModule
βββ View
β βββ YourModuleView.swift
βββ Presenter
β βββ YourModulePresenter.swift
βββ Interactor
β βββ YourModuleInteractor.swift
βββ Entity
β βββ YourModuleEntity.swift
βββ Router
βββ YourModuleRouter.swift
- Clone this repository or download the ZIP.
- Copy the folder
VIPER Module Folder Structure.xctemplateto:
~/Library/Developer/Xcode/Templates/If the Templates folder doesn't exist, simply create it.
- Restart Xcode to load the new template.
- Open Xcode and select the folder where you want to create your module.
- Go to
File β New β Fileor pressCmd + N. - Select
VIPER Module Folder Structurefrom the template list. - Enter your module name and Xcode will generate the VIPER module structure automatically.
- Xcode 14 or later (SwiftUI compatible)
- Swift 5.7 or newer
| Component | Responsibility |
|---|---|
| View | Displays UI and handles user interactions |
| Interactor | Contains business logic and data handling |
| Presenter | Mediates between View and Interactor |
| Entity | Defines models and data structures |
| Router | Manages navigation and module assembly |
Feel free to contribute by:
- Reporting issues
- Submitting pull requests
- Improving documentation
Distributed under the MIT License. See LICENSE for more information.
βοΈ If you found this template helpful, consider starring this repository! βοΈ
Happy coding! π