diff --git a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Action.swift b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Action.swift index e67a7b8..8ea1747 100644 --- a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Action.swift +++ b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Action.swift @@ -1,4 +1,4 @@ //___FILEHEADER___ -enum ___FILEBASENAMEASIDENTIFIER___: Equatable { +public enum ___FILEBASENAMEASIDENTIFIER___: Equatable { } diff --git a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Environment.swift b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Environment.swift index d4e3ddc..8b35893 100644 --- a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Environment.swift +++ b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Environment.swift @@ -1,6 +1,6 @@ //___FILEHEADER___ -import Combine - -struct ___FILEBASENAMEASIDENTIFIER___ { +public struct ___FILEBASENAMEASIDENTIFIER___ { + public init() { + } } diff --git a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Reducer.swift b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Reducer.swift index adf7424..7328f98 100644 --- a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Reducer.swift +++ b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___Reducer.swift @@ -2,13 +2,13 @@ import ComposableArchitecture -typealias ___FILEBASENAMEASIDENTIFIER___ = Reducer< +public typealias ___FILEBASENAMEASIDENTIFIER___ = Reducer< ___VARIABLE_productName:identifier___State, ___VARIABLE_productName:identifier___Action, ___VARIABLE_productName:identifier___Environment > -extension ___FILEBASENAMEASIDENTIFIER___ { +public extension ___FILEBASENAMEASIDENTIFIER___ { init() { self = Self .combine( diff --git a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___State.swift b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___State.swift index a0cd112..e045912 100644 --- a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___State.swift +++ b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___State.swift @@ -1,6 +1,6 @@ //___FILEHEADER___ -import ComposableArchitecture - -struct ___FILEBASENAMEASIDENTIFIER___: Equatable { +public struct ___FILEBASENAMEASIDENTIFIER___: Equatable { + public init() { + } } diff --git a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___View.swift b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___View.swift index a94db7a..3f65cca 100644 --- a/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___View.swift +++ b/templates/Swift Files for TCA.xctemplate/Default/___FILEBASENAME___View.swift @@ -5,33 +5,33 @@ import SwiftUI // MARK: View -struct ___FILEBASENAMEASIDENTIFIER___: View { +public struct ___FILEBASENAMEASIDENTIFIER___: View { @ObservedObject private var viewStore: ___VARIABLE_productName:identifier___ViewStore private let store: ___VARIABLE_productName:identifier___Store - init(store: ___VARIABLE_productName:identifier___Store) { + public init(store: ___VARIABLE_productName:identifier___Store) { self.viewStore = ViewStore(store) self.store = store } - var body: some View { - Text("Hello, ___VARIABLE_productName:identifier___!") + public var body: some View { + Text("Hello, ___VARIABLE_productName:identifier___!") } } // MARK: Store -typealias ___VARIABLE_productName:identifier___Store = Store< +public typealias ___VARIABLE_productName:identifier___Store = Store< ___VARIABLE_productName:identifier___State, ___VARIABLE_productName:identifier___Action > // MARK: ViewStore -typealias ___VARIABLE_productName:identifier___ViewStore = ViewStore< +public typealias ___VARIABLE_productName:identifier___ViewStore = ViewStore< ___VARIABLE_productName:identifier___State, ___VARIABLE_productName:identifier___Action > @@ -41,11 +41,8 @@ typealias ___VARIABLE_productName:identifier___ViewStore = ViewStore< struct ___FILEBASENAMEASIDENTIFIER____Previews: PreviewProvider { static var previews: some View { - ForEach(ColorScheme.allCases, id: \.self) { colorScheme in - ___FILEBASENAMEASIDENTIFIER___(store: store) - .preferredColorScheme(colorScheme) - .previewLayout(.sizeThatFits) - } + ___FILEBASENAMEASIDENTIFIER___(store: store) + .previewLayout(.sizeThatFits) } static let store: ___VARIABLE_productName:identifier___Store = .init( diff --git a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Action.swift b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Action.swift index 3ee1628..76a2451 100644 --- a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Action.swift +++ b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Action.swift @@ -1,6 +1,6 @@ //___FILEHEADER___ -enum ___FILEBASENAMEASIDENTIFIER___: Equatable { +public enum ___FILEBASENAMEASIDENTIFIER___: Equatable { case increase case decrease } diff --git a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Environment.swift b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Environment.swift index d4e3ddc..8b35893 100644 --- a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Environment.swift +++ b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Environment.swift @@ -1,6 +1,6 @@ //___FILEHEADER___ -import Combine - -struct ___FILEBASENAMEASIDENTIFIER___ { +public struct ___FILEBASENAMEASIDENTIFIER___ { + public init() { + } } diff --git a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Reducer.swift b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Reducer.swift index bd6b4a2..31da815 100644 --- a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Reducer.swift +++ b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___Reducer.swift @@ -2,13 +2,13 @@ import ComposableArchitecture -typealias ___FILEBASENAMEASIDENTIFIER___ = Reducer< +public typealias ___FILEBASENAMEASIDENTIFIER___ = Reducer< ___VARIABLE_productName:identifier___State, ___VARIABLE_productName:identifier___Action, ___VARIABLE_productName:identifier___Environment > -extension ___FILEBASENAMEASIDENTIFIER___ { +public extension ___FILEBASENAMEASIDENTIFIER___ { init() { self = Self .combine( diff --git a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___State.swift b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___State.swift index 15be6cb..3dba5a9 100644 --- a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___State.swift +++ b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___State.swift @@ -1,7 +1,9 @@ //___FILEHEADER___ -import ComposableArchitecture - -struct ___FILEBASENAMEASIDENTIFIER___: Equatable { +public struct ___FILEBASENAMEASIDENTIFIER___: Equatable { var counter: Int = 0 + + public init(counter: Int = 0) { + self.counter = counter + } } diff --git a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___View.swift b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___View.swift index 31b5101..b7b2ea5 100644 --- a/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___View.swift +++ b/templates/Swift Files for TCA.xctemplate/WithCounterSample/___FILEBASENAME___View.swift @@ -5,19 +5,19 @@ import SwiftUI // MARK: View -struct ___FILEBASENAMEASIDENTIFIER___: View { +public struct ___FILEBASENAMEASIDENTIFIER___: View { @ObservedObject private var viewStore: ___VARIABLE_productName:identifier___ViewStore private let store: ___VARIABLE_productName:identifier___Store - init(store: ___VARIABLE_productName:identifier___Store) { + public init(store: ___VARIABLE_productName:identifier___Store) { self.viewStore = ViewStore(store) self.store = store } - var body: some View { + public var body: some View { HStack { Button("-") { viewStore.send(.decrease) } Text(String(viewStore.counter)) @@ -28,14 +28,14 @@ struct ___FILEBASENAMEASIDENTIFIER___: View { // MARK: Store -typealias ___VARIABLE_productName:identifier___Store = Store< +public typealias ___VARIABLE_productName:identifier___Store = Store< ___VARIABLE_productName:identifier___State, ___VARIABLE_productName:identifier___Action > // MARK: ViewStore -typealias ___VARIABLE_productName:identifier___ViewStore = ViewStore< +public typealias ___VARIABLE_productName:identifier___ViewStore = ViewStore< ___VARIABLE_productName:identifier___State, ___VARIABLE_productName:identifier___Action > @@ -45,11 +45,8 @@ typealias ___VARIABLE_productName:identifier___ViewStore = ViewStore< struct ___FILEBASENAMEASIDENTIFIER____Previews: PreviewProvider { static var previews: some View { - ForEach(ColorScheme.allCases, id: \.self) { colorScheme in - ___FILEBASENAMEASIDENTIFIER___(store: store) - .preferredColorScheme(colorScheme) - .previewLayout(.sizeThatFits) - } + ___FILEBASENAMEASIDENTIFIER___(store: store) + .previewLayout(.sizeThatFits) } static let store: ___VARIABLE_productName:identifier___Store = .init(