Skip to content

Commit 9c9a846

Browse files
authored
Merge pull request #6 from furkankaplan/v1.1.0
v1.1.0
2 parents a5d99fc + 9e70411 commit 9c9a846

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Product/fk

0 Bytes
Binary file not shown.

fk-architecture-generator-cli-macos/Architectures/MvvmArchitecture.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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
"""

fk-architecture-generator-cli-macos/Architectures/ViperArchitecture.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
"""

0 commit comments

Comments
 (0)