From c93e5a90bda1d70d8a50a8a9c698c69858f1f97a Mon Sep 17 00:00:00 2001 From: Shun Usami Date: Sat, 20 Apr 2019 15:15:52 +0900 Subject: [PATCH] :sparkles: Fix PublicViewController --- .../TemplateInfo.plist | 2 +- .../___FILEBASENAME___ViewController.swift | 1 + .../___FILEBASENAME___ViewController.xib | 0 .../___FILEBASENAME___ViewModel.swift | 0 .../___FILEBASENAME___ViewController.swift | 1 - ...le.swift => ViewController+Emittable.swift} | 18 ++++-------------- .../ViewController+Injectable.swift | 4 ++-- .../ViewController+Interactable.swift | 16 +++++++++++++--- .../___FILEBASENAME___ViewController.swift | 1 + .../___FILEBASENAME___ViewController.xib | 0 .../___FILEBASENAME___ViewController.swift | 1 - .../ViewController.swift | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) create mode 120000 PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewController.swift rename PublicViewController.xctemplate/{ViewController with ViewModel-Instantiatable Injectable Interactable => ViewController with ViewModel-Instantiatable Emittable}/___FILEBASENAME___ViewController.xib (100%) rename PublicViewController.xctemplate/{ViewController with ViewModel-Instantiatable Injectable Interactable => ViewController with ViewModel-Instantiatable Emittable}/___FILEBASENAME___ViewModel.swift (100%) delete mode 120000 PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift rename PublicViewController.xctemplate/{ViewController+Injectable+Interactable.swift => ViewController+Emittable.swift} (71%) create mode 120000 PublicViewController.xctemplate/ViewController-Instantiatable Emittable/___FILEBASENAME___ViewController.swift rename PublicViewController.xctemplate/{ViewController-Instantiatable Injectable Interactable => ViewController-Instantiatable Emittable}/___FILEBASENAME___ViewController.xib (100%) delete mode 120000 PublicViewController.xctemplate/ViewController-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift diff --git a/PublicViewController.xctemplate/TemplateInfo.plist b/PublicViewController.xctemplate/TemplateInfo.plist index ce7044d..5e5508a 100644 --- a/PublicViewController.xctemplate/TemplateInfo.plist +++ b/PublicViewController.xctemplate/TemplateInfo.plist @@ -60,8 +60,8 @@ -Instantiatable -Instantiatable Injectable + -Instantiatable Emittable -Instantiatable Interactable - -Instantiatable Injectable Interactable diff --git a/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewController.swift b/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewController.swift new file mode 120000 index 0000000..02668ce --- /dev/null +++ b/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewController.swift @@ -0,0 +1 @@ +../ViewController+Emittable.swift \ No newline at end of file diff --git a/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.xib b/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewController.xib similarity index 100% rename from PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.xib rename to PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewController.xib diff --git a/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewModel.swift b/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewModel.swift similarity index 100% rename from PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewModel.swift rename to PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Emittable/___FILEBASENAME___ViewModel.swift diff --git a/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift b/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift deleted file mode 120000 index a084b20..0000000 --- a/PublicViewController.xctemplate/ViewController with ViewModel-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift +++ /dev/null @@ -1 +0,0 @@ -../ViewController+Injectable+Interactable.swift \ No newline at end of file diff --git a/PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift b/PublicViewController.xctemplate/ViewController+Emittable.swift similarity index 71% rename from PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift rename to PublicViewController.xctemplate/ViewController+Emittable.swift index a47a86b..8c0ceeb 100644 --- a/PublicViewController.xctemplate/ViewController+Injectable+Interactable.swift +++ b/PublicViewController.xctemplate/ViewController+Emittable.swift @@ -3,32 +3,22 @@ import UIKit import AppCore -public final class ___FILEBASENAME___: UIViewController, Instantiatable, Injectable, Interactable { +public final class ___FILEBASENAME___: UIViewController, Instantiatable, Emittable { // MARK: - Mew.Instantiatable - typealias Input = <#value#> + public typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment - // MARK: - Mew.Injectable - private var input: Input { - didSet { updateUI() } - } - - func input(_ input: Input) { - self.input = input - } - // MARK: - Mew.Emittable - typealias Output = <#value#> + public typealias Output = <#value#> private var handler: ((Output) -> Void)? - func output(_ handler: ((Output) -> Void)?) { + public 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 183efba..57d3984 100644 --- a/PublicViewController.xctemplate/ViewController+Injectable.swift +++ b/PublicViewController.xctemplate/ViewController+Injectable.swift @@ -6,7 +6,7 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable, Injectable { // MARK: - Mew.Instantiatable - typealias Input = <#value#> + public typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment @@ -15,7 +15,7 @@ public final class ___FILEBASENAME___: UIViewController, Instantiatable, Injecta didSet { updateUI() } } - func input(_ input: Input) { + public func input(_ input: Input) { self.input = input } diff --git a/PublicViewController.xctemplate/ViewController+Interactable.swift b/PublicViewController.xctemplate/ViewController+Interactable.swift index 4c69463..b3ba36f 100644 --- a/PublicViewController.xctemplate/ViewController+Interactable.swift +++ b/PublicViewController.xctemplate/ViewController+Interactable.swift @@ -6,19 +6,29 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable, Interactable { // MARK: - Mew.Instantiatable - typealias Input = <#value#> + public typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment + // MARK: - Mew.Injectable + private var input: Input { + didSet { updateUI() } + } + + public func input(_ input: Input) { + self.input = input + } + // MARK: - Mew.Emittable - typealias Output = <#value#> + public typealias Output = <#value#> private var handler: ((Output) -> Void)? - func output(_ handler: ((Output) -> Void)?) { + public 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-Instantiatable Emittable/___FILEBASENAME___ViewController.swift b/PublicViewController.xctemplate/ViewController-Instantiatable Emittable/___FILEBASENAME___ViewController.swift new file mode 120000 index 0000000..02668ce --- /dev/null +++ b/PublicViewController.xctemplate/ViewController-Instantiatable Emittable/___FILEBASENAME___ViewController.swift @@ -0,0 +1 @@ +../ViewController+Emittable.swift \ No newline at end of file diff --git a/PublicViewController.xctemplate/ViewController-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.xib b/PublicViewController.xctemplate/ViewController-Instantiatable Emittable/___FILEBASENAME___ViewController.xib similarity index 100% rename from PublicViewController.xctemplate/ViewController-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.xib rename to PublicViewController.xctemplate/ViewController-Instantiatable Emittable/___FILEBASENAME___ViewController.xib diff --git a/PublicViewController.xctemplate/ViewController-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift b/PublicViewController.xctemplate/ViewController-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift deleted file mode 120000 index a084b20..0000000 --- a/PublicViewController.xctemplate/ViewController-Instantiatable Injectable Interactable/___FILEBASENAME___ViewController.swift +++ /dev/null @@ -1 +0,0 @@ -../ViewController+Injectable+Interactable.swift \ No newline at end of file diff --git a/PublicViewController.xctemplate/ViewController.swift b/PublicViewController.xctemplate/ViewController.swift index 8fab972..a682ebf 100644 --- a/PublicViewController.xctemplate/ViewController.swift +++ b/PublicViewController.xctemplate/ViewController.swift @@ -6,7 +6,7 @@ import AppCore public final class ___FILEBASENAME___: UIViewController, Instantiatable { // MARK: - Mew.Instantiatable - typealias Input = <#value#> + public typealias Input = <#value#> public typealias Environment = EnvironmentProvider public var environment: Environment