From f568bb72af02a41978eb44d92091c33e2ab9e7ab Mon Sep 17 00:00:00 2001 From: tomokisun Date: Tue, 26 Dec 2023 00:56:01 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20xctemplate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .swiftformat | 4 ++++ XCTemplates/TCA.xctemplate/___FILEBASENAME___.swift | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.swiftformat b/.swiftformat index ffa4d5a8..b02f99ba 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,3 +1,7 @@ +# file options + +--exclude ./XCTemplates + # format options --stripunusedargs closure-only diff --git a/XCTemplates/TCA.xctemplate/___FILEBASENAME___.swift b/XCTemplates/TCA.xctemplate/___FILEBASENAME___.swift index d51108ac..baae9e06 100644 --- a/XCTemplates/TCA.xctemplate/___FILEBASENAME___.swift +++ b/XCTemplates/TCA.xctemplate/___FILEBASENAME___.swift @@ -10,7 +10,7 @@ public struct ___VARIABLE_productName: identifier___Logic { public init() {} } - public enum Action: Equatable { + public enum Action { case onTask case onAppear } @@ -18,7 +18,7 @@ public struct ___VARIABLE_productName: identifier___Logic { @Dependency(\.analytics) var analytics public var body: some Reducer { - Reduce { _, action in + Reduce { state, action in switch action { case .onTask: return .none @@ -39,11 +39,11 @@ public struct ___VARIABLE_productName:identifier___View: View { } public var body: some View { - WithViewStore(store, observe: { $0 }) { _ in + WithViewStore(store, observe: { $0 }) { viewStore in List { Text("___VARIABLE_productName:identifier___", bundle: .module) } - .navigationTitle("___VARIABLE_productName:identifier___") + .navigationTitle(String(localized: "___VARIABLE_productName:identifier___", bundle: .module)) .navigationBarTitleDisplayMode(.inline) .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) }