Skip to content

thuongvb/VIPER-Module-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VIPER Module Template for Xcode (SwiftUI)

A customizable Xcode template to quickly generate clean VIPER architecture modules for SwiftUI-based projects, with a clear and organized folder structure.


πŸš€ Features

  • 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.

πŸ—‚ Template Structure

YourModule
β”œβ”€β”€ View
β”‚   └── YourModuleView.swift
β”œβ”€β”€ Presenter
β”‚   └── YourModulePresenter.swift
β”œβ”€β”€ Interactor
β”‚   └── YourModuleInteractor.swift
β”œβ”€β”€ Entity
β”‚   └── YourModuleEntity.swift
└── Router
    └── YourModuleRouter.swift

πŸ“₯ Installation

Step 1: Download

  • Clone this repository or download the ZIP.

Step 2: Copy to Templates Folder

  • Copy the folder VIPER Module Folder Structure.xctemplate to:
~/Library/Developer/Xcode/Templates/

If the Templates folder doesn't exist, simply create it.

Step 3: Restart Xcode

  • Restart Xcode to load the new template.

βœ… Usage

  • Open Xcode and select the folder where you want to create your module.
  • Go to File β†’ New β†’ File or press Cmd + N.
  • Select VIPER Module Folder Structure from the template list.
  • Enter your module name and Xcode will generate the VIPER module structure automatically.

⚠️ Requirements

  • Xcode 14 or later (SwiftUI compatible)
  • Swift 5.7 or newer

πŸ“– VIPER Architecture Overview

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

πŸ“Œ Contributing

Feel free to contribute by:

  • Reporting issues
  • Submitting pull requests
  • Improving documentation

πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.


⭐️ If you found this template helpful, consider starring this repository! ⭐️

Happy coding! πŸš€

About

πŸš€ VIPER Xcode Template for SwiftUI – Build clean & scalable modules instantly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •