Template to generate VIPER classes on Xcode.
VIPER is a backronym for View, Interactor, Presenter, Entity and Router. It’s basically an approach that implements the Single Responsibility Principle to create a cleaner and more modular structure for your iOS project. You can learn more about it in this blog post.
- Download VIPER Template or clone the project
- Copy the
Design Pattern
folder to~/Library/Developer/Xcode/Templates/File Templates/
or create a symbolic link to that folder.
- Start Xcode and create a new group for your VIPER module
- Create a new file (
File > New > File
or⌘N
) - Choose
Design Pattern
andVIPER
PS: Don't forget to add the ReusableView protocol extension and both the UIViewController and UIStoryboard extensions to your project.
Contract
-> Contains all the protocols used in VIPERInteractor
Presenter
ViewController
(AKA View)Router