├── Module VIPER
├── Module VIPER.xctemplate
│ ├── TemplateIcon.icns
│ ├── TemplateInfo.plist
│ ├── ___FILEBASENAME___.storyboard
│ ├── ___FILEBASENAME___Entity.swift
│ ├── ___FILEBASENAME___Interactor.swift
│ ├── ___FILEBASENAME___Presenter.swift
│ ├── ___FILEBASENAME___Protocols.swift
│ ├── ___FILEBASENAME___Router.swift
│ └── ___FILEBASENAME___ViewController.swift
└── README.md
└── README.md
/Module VIPER/Module VIPER.xctemplate/TemplateIcon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mahmoud3allam/Module-Viper-Template/700b214e623b0cecdc8a994cfc175e7701249c41/Module VIPER/Module VIPER.xctemplate/TemplateIcon.icns
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/TemplateInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | AllowedTypes
6 |
7 | public.swift-source
8 |
9 | Platforms
10 |
11 | com.apple.platform.iphoneos
12 |
13 | DefaultCompletionName
14 | SwiftViperModule
15 | Description
16 | Basic Swift VIPER module template. Creates View, Interactor, Presenter, Router with protocols.
17 | Kind
18 | Xcode.IDEKit.TextSubstitutionFileTemplateKind
19 | MainTemplateFile
20 | ___FILEBASENAME___
21 | SortOrder
22 | 7
23 | Options
24 |
25 |
26 | Description
27 | Name of module that you need create
28 | Default
29 |
30 | Identifier
31 | viperModuleName
32 | NotPersisted
33 |
34 | Name
35 | Module name
36 | Required
37 | YES
38 | Type
39 | text
40 |
41 |
42 | Default
43 | ___VARIABLE_viperModuleName___
44 | Identifier
45 | productName
46 | Type
47 | static
48 |
49 |
50 | Template Author
51 | Manish Kumar @manish-1612
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___Entity.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ___FILENAME___
3 | // ___PROJECTNAME___
4 | //
5 | // Created ___FULLUSERNAME___ on ___DATE___.
6 | // Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7 | //
8 | //@Mahmoud Allam Templete ^_^
9 | import Foundation
10 | class ___VARIABLE_viperModuleName___Model {
11 | //Scene Main Model..
12 | }
13 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___Interactor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ___FILENAME___
3 | // ___PROJECTNAME___
4 | //
5 | // Created ___FULLUSERNAME___ on ___DATE___.
6 | // Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7 | //
8 | //@Mahmoud Allam Templete ^_^
9 | import Foundation
10 | class ___VARIABLE_viperModuleName___Interactor: ___VARIABLE_viperModuleName___InteractorInPutProtocol {
11 | var presenter: ___VARIABLE_viperModuleName___InteractorOutPutProtocol?
12 | }
13 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___Presenter.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ___FILENAME___
3 | // ___PROJECTNAME___
4 | //
5 | // Created ___FULLUSERNAME___ on ___DATE___.
6 | // Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7 | //
8 | //@Mahmoud Allam Templete ^_^
9 |
10 | import Foundation
11 | class ___VARIABLE_viperModuleName___Presenter: ___VARIABLE_viperModuleName___PresenterProtocol, ___VARIABLE_viperModuleName___InteractorOutPutProtocol {
12 | weak var view: ___VARIABLE_viperModuleName___ViewProtocol?
13 | private let interactor: ___VARIABLE_viperModuleName___InteractorInPutProtocol
14 | private let router: ___VARIABLE_viperModuleName___RouterProtocol
15 | init(view: ___VARIABLE_viperModuleName___ViewProtocol, interactor: ___VARIABLE_viperModuleName___InteractorInPutProtocol, router: ___VARIABLE_viperModuleName___RouterProtocol) {
16 | self.view = view
17 | self.interactor = interactor
18 | self.router = router
19 | }
20 | func viewDidLoad() {
21 | print("ViewDidLoad")
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___Protocols.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ___FILENAME___
3 | // ___PROJECTNAME___
4 | //
5 | // Created ___FULLUSERNAME___ on ___DATE___.
6 | // Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7 | //
8 | //@Mahmoud Allam Templete ^_^
9 | import Foundation
10 | protocol ___VARIABLE_viperModuleName___ViewProtocol: class {
11 | var presenter: ___VARIABLE_viperModuleName___PresenterProtocol! {get set}
12 | }
13 | protocol ___VARIABLE_viperModuleName___PresenterProtocol {
14 | var view: ___VARIABLE_viperModuleName___ViewProtocol? {get set}
15 | func viewDidLoad()
16 | }
17 | protocol ___VARIABLE_viperModuleName___RouterProtocol {
18 | }
19 | protocol ___VARIABLE_viperModuleName___InteractorInPutProtocol {
20 | var presenter: ___VARIABLE_viperModuleName___InteractorOutPutProtocol? {get set}
21 | }
22 | protocol ___VARIABLE_viperModuleName___InteractorOutPutProtocol {
23 | }
24 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___Router.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ___FILENAME___
3 | // ___PROJECTNAME___
4 | //
5 | // Created ___FULLUSERNAME___ on ___DATE___.
6 | // Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7 | //
8 | //@Mahmoud Allam Templete ^_^
9 | import UIKit
10 | class ___VARIABLE_viperModuleName___Router: ___VARIABLE_viperModuleName___RouterProtocol {
11 | weak var viewController: UIViewController?
12 | static func createAnModule() -> UIViewController {
13 | let interactor = ___VARIABLE_viperModuleName___Interactor()
14 | let router = ___VARIABLE_viperModuleName___Router()
15 | let view = ___VARIABLE_viperModuleName___ViewController()
16 | let presenter = ___VARIABLE_viperModuleName___Presenter(view: view, interactor: interactor, router: router)
17 | view.presenter = presenter
18 | interactor.presenter = presenter
19 | router.viewController = view
20 | return view
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Module VIPER/Module VIPER.xctemplate/___FILEBASENAME___ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ___FILENAME___
3 | // ___PROJECTNAME___
4 | //
5 | // Created ___FULLUSERNAME___ on ___DATE___.
6 | // Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7 | //
8 | //@Mahmoud Allam Templete ^_^
9 | import UIKit
10 | class ___VARIABLE_viperModuleName___ViewController: UIViewController, ___VARIABLE_viperModuleName___ViewProtocol {
11 | var presenter: ___VARIABLE_viperModuleName___PresenterProtocol!
12 | override func viewDidLoad() {
13 | super.viewDidLoad()
14 | presenter.viewDidLoad()
15 | // Do any additional setup after loading the view.
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Module VIPER/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Viper_Module_Template
3 | The respository contains a Module template in VIPER architecture. The module contains all the files like (View , Interactor , presenter , clean model , Router) also storyboard and the protocols file .
4 |
5 | # Configurations
6 | 1. Download or clone the respository.
7 | 2. find a folder named `Module VIPER.xctemplate`.
8 | 3. Copy the template.
9 | 4. Go to Location `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File\ Templates/Source`.
10 | 5. Paste there.
11 | 6. quite XCode if its opened.
12 | 7. open Xcode again , add new file .
13 | 8. Choose Module VIPER.
14 | HF ˆ_ˆ
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Module-Viper-Template
2 |
3 |
4 | If you using VIPER you need to create 5 files per Scene ...lets Imagine that you got 100 Scene.
5 | thats why i created this Temp ,
6 | i was suffering this issue its really annoying.
7 |
8 |
9 | ### How to bring this Temp to your Xcode.
10 | 1. Clone/Download Repo
11 | 2. Copy Module VIPER.xctemplate
12 | 3. Go to Finder
13 | 4. Press CMD + Shift + G
14 | 5. Copy (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File\Templates/Source)
15 | 6. Go to file Templates Folder
16 | 7. Go to Source Folder
17 | 8. paste Module VIPER.xctemplate
18 |
19 | ### Usage.
20 | CMD + SHIFT + N and Choose Module VIPER
21 |
22 | 
23 |
24 | Enter Scene Name
25 |
26 | 
27 |
28 |
29 | ## Generated code
30 | (View , Interactor , Clean Model , Presenter , Protocols , also storyboard if you using it)
31 |
32 | 
33 |
34 | 
35 |
36 | ## Mahmoud Allam
37 |
--------------------------------------------------------------------------------