File tree 6 files changed +181
-19
lines changed
Tooling/Templates/Workflow (Verbose).xctemplate
generateWorkerReactiveSwift
6 files changed +181
-19
lines changed Original file line number Diff line number Diff line change 1
1
// ___FILEHEADER___
2
2
3
- import ReactiveSwift
4
3
import Workflow
5
- import WorkflowReactiveSwift
6
4
import WorkflowUI
7
5
8
6
// MARK: Input and Output
@@ -37,22 +35,6 @@ extension ___VARIABLE_productName___Workflow {
37
35
}
38
36
}
39
37
40
- // MARK: Workers
41
-
42
- extension ___VARIABLE_productName___Workflow {
43
- struct ___VARIABLE_productName___Worker : Worker {
44
- enum Output { }
45
-
46
- func run( ) -> SignalProducer < Output , Never > {
47
- fatalError ( )
48
- }
49
-
50
- func isEquivalent( to otherWorker: ___VARIABLE_productName___Worker ) -> Bool {
51
- return true
52
- }
53
- }
54
- }
55
-
56
38
// MARK: Rendering
57
39
58
40
extension ___VARIABLE_productName___Workflow {
Original file line number Diff line number Diff line change 18
18
<key >Name </key >
19
19
<string >Name: </string >
20
20
<key >Description </key >
21
- <string >The name of the workflow to create. " Workflow" will be appended to the name. </string >
21
+ <string >The name of the workflow to create. " Workflow" will be appended to the name. </string >
22
22
<key >Type </key >
23
23
<string >text </string >
24
24
<key >Default </key >
25
25
<string >HelloWorld </string >
26
26
</dict >
27
+ <dict >
28
+ <key >Identifier </key >
29
+ <string >generateWorker </string >
30
+ <key >Required </key >
31
+ <true />
32
+ <key >Name </key >
33
+ <string >Also create a Worker </string >
34
+ <key >Description </key >
35
+ <string >Workers define a unit of asynchronous work </string >
36
+ <key >Type </key >
37
+ <string >checkbox </string >
38
+ <key >Default </key >
39
+ <string >false </string >
40
+ </dict >
41
+ <dict >
42
+ <key >Identifier </key >
43
+ <string >streamType </string >
44
+ <key >Required </key >
45
+ <true />
46
+ <key >Name </key >
47
+ <string >Uses: </string >
48
+ <key >Description </key >
49
+ <string >Whether to use RxSwift or ReactiveSwift </string >
50
+ <key >Type </key >
51
+ <string >popup </string >
52
+ <key >Default </key >
53
+ <string >ReactiveSwift </string >
54
+ <key >RequiredOptions </key >
55
+ <dict >
56
+ <key >generateWorker </key >
57
+ <array >
58
+ <string >true </string >
59
+ </array >
60
+ </dict >
61
+ <key >Values </key >
62
+ <array >
63
+ <string >RxSwift </string >
64
+ <string >ReactiveSwift </string >
65
+ </array >
66
+ </dict >
27
67
</array >
28
68
</dict >
29
69
</plist >
Original file line number Diff line number Diff line change
1
+ // ___FILEHEADER___
2
+
3
+ import ReactiveSwift
4
+ import Workflow
5
+ import WorkflowReactiveSwift
6
+ import WorkflowUI
7
+
8
+ // MARK: Workers
9
+
10
+ extension ___VARIABLE_productName___Workflow {
11
+ struct ___VARIABLE_productName___Worker : Worker {
12
+ enum Output { }
13
+
14
+ func run( ) -> SignalProducer < Output , Never > {
15
+ fatalError ( )
16
+ }
17
+
18
+ func isEquivalent( to otherWorker: ___VARIABLE_productName___Worker ) -> Bool {
19
+ return true
20
+ }
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ // ___FILEHEADER___
2
+
3
+ import Workflow
4
+ import WorkflowUI
5
+
6
+ // MARK: Input and Output
7
+
8
+ struct ___VARIABLE_productName___Workflow : Workflow {
9
+ enum Output { }
10
+ }
11
+
12
+ // MARK: State and Initialization
13
+
14
+ extension ___VARIABLE_productName___Workflow {
15
+ struct State { }
16
+
17
+ func makeInitialState( ) -> ___VARIABLE_productName___Workflow . State {
18
+ return State ( )
19
+ }
20
+
21
+ func workflowDidChange( from previousWorkflow: ___VARIABLE_productName___Workflow , state: inout State ) { }
22
+ }
23
+
24
+ // MARK: Actions
25
+
26
+ extension ___VARIABLE_productName___Workflow {
27
+ enum Action : WorkflowAction {
28
+ typealias WorkflowType = ___VARIABLE_productName___Workflow
29
+
30
+ func apply( toState state: inout ___VARIABLE_productName___Workflow . State ) -> ___VARIABLE_productName___Workflow . Output ? {
31
+ switch self {
32
+ // Update state and produce an optional output based on which action was received.
33
+ }
34
+ }
35
+ }
36
+ }
37
+
38
+ // MARK: Rendering
39
+
40
+ extension ___VARIABLE_productName___Workflow {
41
+ // TODO: Change this to your actual rendering type
42
+ typealias Rendering = String
43
+
44
+ func render( state: ___VARIABLE_productName___Workflow . State , context: RenderContext < ___VARIABLE_productName___Workflow > ) -> Rendering {
45
+ #warning("Don't forget your render implementation and to return the correct rendering type!")
46
+ return " This is likely not the rendering that you want to return "
47
+ }
48
+ }
Original file line number Diff line number Diff line change
1
+ // ___FILEHEADER___
2
+
3
+ import RxSwift
4
+ import Workflow
5
+ import WorkflowRxSwift
6
+ import WorkflowUI
7
+
8
+ // MARK: Workers
9
+
10
+ extension ___VARIABLE_productName___Workflow {
11
+ struct ___VARIABLE_productName___Worker : Worker {
12
+ enum Output { }
13
+
14
+ func run( ) -> Observable < Output > {
15
+ fatalError ( )
16
+ }
17
+
18
+ func isEquivalent( to otherWorker: ___VARIABLE_productName___Worker ) -> Bool {
19
+ return true
20
+ }
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ // ___FILEHEADER___
2
+
3
+ import Workflow
4
+ import WorkflowUI
5
+
6
+ // MARK: Input and Output
7
+
8
+ struct ___VARIABLE_productName___Workflow : Workflow {
9
+ enum Output { }
10
+ }
11
+
12
+ // MARK: State and Initialization
13
+
14
+ extension ___VARIABLE_productName___Workflow {
15
+ struct State { }
16
+
17
+ func makeInitialState( ) -> ___VARIABLE_productName___Workflow . State {
18
+ return State ( )
19
+ }
20
+
21
+ func workflowDidChange( from previousWorkflow: ___VARIABLE_productName___Workflow , state: inout State ) { }
22
+ }
23
+
24
+ // MARK: Actions
25
+
26
+ extension ___VARIABLE_productName___Workflow {
27
+ enum Action : WorkflowAction {
28
+ typealias WorkflowType = ___VARIABLE_productName___Workflow
29
+
30
+ func apply( toState state: inout ___VARIABLE_productName___Workflow . State ) -> ___VARIABLE_productName___Workflow . Output ? {
31
+ switch self {
32
+ // Update state and produce an optional output based on which action was received.
33
+ }
34
+ }
35
+ }
36
+ }
37
+
38
+ // MARK: Rendering
39
+
40
+ extension ___VARIABLE_productName___Workflow {
41
+ // TODO: Change this to your actual rendering type
42
+ typealias Rendering = String
43
+
44
+ func render( state: ___VARIABLE_productName___Workflow . State , context: RenderContext < ___VARIABLE_productName___Workflow > ) -> Rendering {
45
+ #warning("Don't forget your render implementation and to return the correct rendering type!")
46
+ return " This is likely not the rendering that you want to return "
47
+ }
48
+ }
You can’t perform that action at this time.
0 commit comments