Skip to content

Commit 6efbf89

Browse files
Remove NodePresetStencilContext (#586)
* Remove NodePresetStencilContext * Rename NodePreset to Preset * Fix invalid preset tests
1 parent 8b155c0 commit 6efbf89

12 files changed

+411
-436
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// Copyright © 2023 Tinder (Match Group, LLC)
3+
//
4+
5+
public enum Preset: String {
6+
7+
case app = "App"
8+
case scene = "Scene"
9+
case window = "Window"
10+
case root = "Root"
11+
12+
public var nodeName: String {
13+
rawValue
14+
}
15+
16+
public var isViewInjected: Bool {
17+
switch self {
18+
case .app:
19+
return true
20+
case .scene:
21+
return true
22+
case .window:
23+
return true
24+
case .root:
25+
return false
26+
}
27+
}
28+
}

Sources/NodesXcodeTemplatesGenerator/StencilContext.swift

+3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import Foundation
77
public enum StencilContextError: LocalizedError, Equatable {
88

99
case reservedNodeName(String)
10+
case invalidPreset(String)
1011

1112
public var errorDescription: String? {
1213
switch self {
1314
case let .reservedNodeName(nodeName):
1415
return "ERROR: Reserved Node Name (\(nodeName))"
16+
case let .invalidPreset(preset):
17+
return "ERROR: Invalid Preset (\(preset))"
1518
}
1619
}
1720
}

Sources/NodesXcodeTemplatesGenerator/StencilContexts/NodePresetStencilContext.swift

-195
This file was deleted.

0 commit comments

Comments
 (0)