Skip to content

Commit d63cd8c

Browse files
committed
Add MVP-C Structure.xctemplate
1 parent 612bb77 commit d63cd8c

9 files changed

+104
-0
lines changed
2.39 KB
Loading
5.8 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Kind</key>
6+
<string>Xcode.IDEKit.TextSubstitutionFileTemplateKind</string>
7+
<key>Options</key>
8+
<array>
9+
<dict>
10+
<key>Identifier</key>
11+
<string>productName</string>
12+
<key>Required</key>
13+
<true/>
14+
<key>Name</key>
15+
<string>Module:</string>
16+
<key>Description</key>
17+
<string>MVP-C Module Name</string>
18+
<key>Type</key>
19+
<string>text</string>
20+
<key>Default</key>
21+
<string>MVP-C Module</string>
22+
</dict>
23+
</array>
24+
</dict>
25+
</plist>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// ___FILEHEADER___
2+
3+
import UIKit
4+
5+
final class ___FILEBASENAMEASIDENTIFIER___: NSObject, ___VARIABLE_productName___CoordinatorProtocol {
6+
var childCoordinators: [CoordinatorProtocol]?
7+
var parent: CoordinatorProtocol?
8+
9+
var navigationController: UIViewController?
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// ___FILEHEADER___
2+
3+
import UIKit
4+
5+
protocol ___FILEBASENAMEASIDENTIFIER___: CoordinatorProtocol {
6+
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// ___FILEHEADER___
2+
3+
import UIKit
4+
5+
final class ___FILEBASENAMEASIDENTIFIER___: ___VARIABLE_productName___PresenterProtocol {
6+
typealias PresenterView = ___VARIABLE_productName___ViewController
7+
typealias Coordinator = ___VARIABLE_productName___Coordinator
8+
9+
var view: PresenterView?
10+
var coordinator: Coordinator?
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// ___FILEHEADER___
2+
3+
import UIKit
4+
5+
protocol ___FILEBASENAMEASIDENTIFIER___: PresenterProtocol {
6+
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// ___FILEHEADER___
2+
3+
import UIKit
4+
5+
final class ___FILEBASENAMEASIDENTIFIER___: UIView {
6+
init() {
7+
super.init(frame: .zero)
8+
}
9+
10+
required init?(coder _: NSCoder) {
11+
fatalError("init(coder:) has not been implemented")
12+
}
13+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// ___FILEHEADER___
2+
3+
import UIKit
4+
5+
// View creation example:
6+
// let presenter = ___VARIABLE_productName___Presenter()
7+
// let coordinator = ___VARIABLE_productName___Coordinator(navigationController: navigationController!, parent: self)
8+
// presenter.setCoordinator(coordinator: coordinator)
9+
//
10+
// let viewController = ___VARIABLE_productName___ViewController(presenter: presenter)
11+
// presenter.setPresenterView(view: viewController)
12+
13+
final class ___FILEBASENAMEASIDENTIFIER___: UIViewController, PresenterViewProtocol {
14+
typealias Presenter = ___VARIABLE_productName___Presenter
15+
var presenter: Presenter
16+
17+
var contentView = ___VARIABLE_productName___View()
18+
19+
required init(presenter: Presenter) {
20+
self.presenter = presenter
21+
super.init(nibName: nil, bundle: nil)
22+
}
23+
24+
required init?(coder _: NSCoder) {
25+
fatalError("init(coder:) has not been implemented")
26+
}
27+
28+
override func loadView() {
29+
view = contentView
30+
}
31+
}

0 commit comments

Comments
 (0)