diff --git a/PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift b/PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift index 8686d81..a47a86b 100644 --- a/PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift +++ b/PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift @@ -6,27 +6,29 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable, Injectable, Interactable { // MARK: - Mew.Instantiatable - public struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment // MARK: - Mew.Injectable - public func input(_ input: Input) { - <#code#> + private var input: Input { + didSet { updateUI() } } - - // MARK: - Mew.Interactable - public struct Output { - let <#name#> = <#value#> + + func input(_ input: Input) { + self.input = input } - public func output(_ handler: ((Output) -> Void)?) { - <#code#> + + // MARK: - Mew.Emittable + typealias Output = <#value#> + private var handler: ((Output) -> Void)? + func output(_ handler: ((Output) -> Void)?) { + self.handler = handler } public init(with input: Input, environment: Environment) { self.environment = environment + self.input = input super.init(nibName: nil, bundle: Bundle(for: type(of: self))) } diff --git a/PublicViewController.xctemplate/ViewController+Injectable.swift b/PublicViewController.xctemplate/ViewController+Injectable.swift index 26161a6..183efba 100644 --- a/PublicViewController.xctemplate/ViewController+Injectable.swift +++ b/PublicViewController.xctemplate/ViewController+Injectable.swift @@ -6,19 +6,22 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable, Injectable { // MARK: - Mew.Instantiatable - public struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment // MARK: - Mew.Injectable - public func input(_ input: Input) { - <#code#> + private var input: Input { + didSet { updateUI() } + } + + func input(_ input: Input) { + self.input = input } public init(with input: Input, environment: Environment) { self.environment = environment + self.input = input super.init(nibName: nil, bundle: Bundle(for: type(of: self))) } diff --git a/PublicViewController.xctemplate/ViewController+Interactable.swift b/PublicViewController.xctemplate/ViewController+Interactable.swift index 84e6867..4c69463 100644 --- a/PublicViewController.xctemplate/ViewController+Interactable.swift +++ b/PublicViewController.xctemplate/ViewController+Interactable.swift @@ -6,18 +6,15 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable, Interactable { // MARK: - Mew.Instantiatable - public struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment - // MARK: - Mew.Interactable - public struct Output { - let <#name#> = <#value#> - } - public func output(_ handler: ((Output) -> Void)?) { - <#code#> + // MARK: - Mew.Emittable + typealias Output = <#value#> + private var handler: ((Output) -> Void)? + func output(_ handler: ((Output) -> Void)?) { + self.handler = handler } public init(with input: Input, environment: Environment) { diff --git a/PublicViewController.xctemplate/ViewController.swift b/PublicViewController.xctemplate/ViewController.swift index 3e6d63b..8fab972 100644 --- a/PublicViewController.xctemplate/ViewController.swift +++ b/PublicViewController.xctemplate/ViewController.swift @@ -6,9 +6,7 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable { // MARK: - Mew.Instantiatable - public struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment diff --git a/ViewController.xctemplate/ViewController+Injectable+Interactable.swift b/ViewController.xctemplate/ViewController+Injectable+Interactable.swift index 59d935b..4d73fae 100644 --- a/ViewController.xctemplate/ViewController+Injectable+Interactable.swift +++ b/ViewController.xctemplate/ViewController+Injectable+Interactable.swift @@ -6,27 +6,29 @@ import AppCore final class ___FILEBASENAME___: UIViewController, Instantiatable, Injectable, Interactable { // MARK: - Mew.Instantiatable - struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> typealias Environment = EnvironmentProvider var environment: Environment // MARK: - Mew.Injectable + private var input: Input { + didSet { updateUI() } + } + func input(_ input: Input) { - <#code#> + self.input = input } - // MARK: - Mew.Interactable - struct Output { - let <#name#> = <#value#> - } + // MARK: - Mew.Emittable + typealias Output = <#value#> + private var handler: ((Output) -> Void)? func output(_ handler: ((Output) -> Void)?) { - <#code#> + self.handler = handler } init(with input: Input, environment: Environment) { self.environment = environment + self.input = input super.init(nibName: nil, bundle: Bundle(for: type(of: self))) } diff --git a/ViewController.xctemplate/ViewController+Injectable.swift b/ViewController.xctemplate/ViewController+Injectable.swift index 5918c34..15ba957 100644 --- a/ViewController.xctemplate/ViewController+Injectable.swift +++ b/ViewController.xctemplate/ViewController+Injectable.swift @@ -6,19 +6,22 @@ import AppCore final class ___FILEBASENAME___: UIViewController, Instantiatable, Injectable { // MARK: - Mew.Instantiatable - struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> typealias Environment = EnvironmentProvider var environment: Environment // MARK: - Mew.Injectable + private var input: Input { + didSet { updateUI() } + } + func input(_ input: Input) { - <#code#> + self.input = input } init(with input: Input, environment: Environment) { self.environment = environment + self.input = input super.init(nibName: nil, bundle: Bundle(for: type(of: self))) } diff --git a/ViewController.xctemplate/ViewController+Interactable.swift b/ViewController.xctemplate/ViewController+Interactable.swift index 7e3fa94..854d1eb 100644 --- a/ViewController.xctemplate/ViewController+Interactable.swift +++ b/ViewController.xctemplate/ViewController+Interactable.swift @@ -6,18 +6,15 @@ import AppCore final class ___FILEBASENAME___: UIViewController, Instantiatable, Interactable { // MARK: - Mew.Instantiatable - struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> typealias Environment = EnvironmentProvider var environment: Environment - // MARK: - Mew.Interactable - struct Output { - let <#name#> = <#value#> - } + // MARK: - Mew.Emittable + typealias Output = <#value#> + private var handler: ((Output) -> Void)? func output(_ handler: ((Output) -> Void)?) { - <#code#> + self.handler = handler } init(with input: Input, environment: Environment) { diff --git a/ViewController.xctemplate/ViewController.swift b/ViewController.xctemplate/ViewController.swift index 5565298..dd1b73f 100644 --- a/ViewController.xctemplate/ViewController.swift +++ b/ViewController.xctemplate/ViewController.swift @@ -6,9 +6,7 @@ import AppCore final class ___FILEBASENAME___: UIViewController, Instantiatable { // MARK: - Mew.Instantiatable - struct Input { - let <#name#> = <#value#> - } + typealias Input = <#value#> typealias Environment = EnvironmentProvider var environment: Environment