Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Sources/XcodeTemplateGeneratorLibrary/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ extension XcodeTemplates {
}

public var uiFrameworks: [UIFramework]
public var isViewInjectedNodeEnabled: Bool
public var includedTemplates: [String]
public var fileHeader: String
public var baseImports: Set<String>
Expand Down Expand Up @@ -113,6 +114,7 @@ extension XcodeTemplates.Config {
// swiftlint:disable:next function_body_length
public init() {
uiFrameworks = [UIFramework(framework: .uiKit), UIFramework(framework: .swiftUI)]
isViewInjectedNodeEnabled = true
includedTemplates = [
"Node",
"NodeSwiftUI",
Expand Down Expand Up @@ -211,6 +213,9 @@ extension XcodeTemplates.Config {
uiFrameworks =
(try? decoder.decode(CodingKeys.uiFrameworks))
?? defaults.uiFrameworks
isViewInjectedNodeEnabled =
(try? decoder.decode(CodingKeys.isViewInjectedNodeEnabled))
?? defaults.isViewInjectedNodeEnabled
includedTemplates =
(try? decoder.decode(CodingKeys.includedTemplates))
?? defaults.includedTemplates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ final class ConfigTests: XCTestCase {
viewControllerProperties: <viewControllerProperties-Custom>
viewControllerMethods: <viewControllerMethods-Custom>
viewControllerMethodsForRootNode: <viewControllerMethodsForRootNode-Custom>
isViewInjectedNodeEnabled: true
includedTemplates:
- includedTemplates-1
- includedTemplates-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
▿ includedTemplates: 2 elements
- "includedTemplates-1"
- "includedTemplates-2"
- isViewInjectedNodeEnabled: true
- publisherFailureType: "publisherFailureType"
- publisherType: "publisherType"
- rootViewControllerMethods: "rootViewControllerMethods"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- "PluginNode"
- "Plugin"
- "Worker"
- isViewInjectedNodeEnabled: true
- publisherFailureType: ", Never"
- publisherType: "AnyPublisher"
- rootViewControllerMethods: "override func viewDidLoad() {\n super.viewDidLoad()\n view.backgroundColor = .systemBackground\n}\n\noverride func viewWillAppear(_ animated: Bool) {\n super.viewWillAppear(animated)\n observe(viewState).store(in: &cancellables)\n}\n\noverride func viewDidAppear(_ animated: Bool) {\n super.viewDidAppear(animated)\n receiver?.viewDidAppear()\n}\n\noverride func viewWillDisappear(_ animated: Bool) {\n super.viewWillDisappear(animated)\n cancellables.removeAll()\n}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- "PluginNode"
- "Plugin"
- "Worker"
- isViewInjectedNodeEnabled: true
- publisherFailureType: ", Never"
- publisherType: "AnyPublisher"
- rootViewControllerMethods: "override func viewDidLoad() {\n super.viewDidLoad()\n view.backgroundColor = .systemBackground\n}\n\noverride func viewWillAppear(_ animated: Bool) {\n super.viewWillAppear(animated)\n observe(viewState).store(in: &cancellables)\n}\n\noverride func viewDidAppear(_ animated: Bool) {\n super.viewDidAppear(animated)\n receiver?.viewDidAppear()\n}\n\noverride func viewWillDisappear(_ animated: Bool) {\n super.viewWillDisappear(animated)\n cancellables.removeAll()\n}"
Expand Down