File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
fk-architecture-generator-cli-macos/Architectures Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ struct MvvmArchitecture: Architecture {
5858
5959 class \( name) ViewController: UIViewController {
6060
61- let viewModel: \( name) ViewModel
61+ var viewModel: \( name) ViewModelProtocol
6262
63- init(viewModel: \( name) ViewModel = \( name) ViewModel()) {
63+ init(viewModel: \( name) ViewModelProtocol = \( name) ViewModel()) {
6464 self.viewModel = viewModel
6565 super.init(nibName: nil, bundle: nil)
6666 }
@@ -91,7 +91,10 @@ struct MvvmArchitecture: Architecture {
9191
9292 import Foundation
9393
94- struct \( name) ViewModel {
94+ protocol \( name) ViewModelProtocol {
95+
96+ }
97+ class \( name) ViewModel: \( name) ViewModelProtocol {
9598
9699 }
97100 """
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ struct ViperArchitecture: Architecture {
8787
8888 class \( name) Interactor: \( name) InteractorProtocol {
8989
90- var presenter: \( name) InteractorOutputProtocol?
90+ weak var presenter: \( name) InteractorOutputProtocol?
9191
9292 }
9393 """
@@ -107,7 +107,7 @@ struct ViperArchitecture: Architecture {
107107
108108 class \( name) Presenter: \( name) PresenterProtocol {
109109
110- var view: \( name) PresenterOutputProtocol?
110+ weak var view: \( name) PresenterOutputProtocol?
111111 var interactor: \( name) InteractorProtocol?
112112 var router: \( name) RouterProtocol?
113113
@@ -164,7 +164,7 @@ struct ViperArchitecture: Architecture {
164164 var router: \( name) RouterProtocol? { get set }
165165 }
166166
167- protocol \( name) PresenterOutputProtocol {
167+ protocol \( name) PresenterOutputProtocol: class {
168168
169169 }
170170
@@ -176,7 +176,7 @@ struct ViperArchitecture: Architecture {
176176 var presenter: \( name) InteractorOutputProtocol? { get set }
177177 }
178178
179- protocol \( name) InteractorOutputProtocol {
179+ protocol \( name) InteractorOutputProtocol: class {
180180
181181 }
182182 """
You can’t perform that action at this time.
0 commit comments