-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from monishsyed/ms/update-templates
Updates to Workflow Templates
- Loading branch information
Showing
6 changed files
with
181 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../Workflow (Verbose).xctemplate/generateWorkerReactiveSwift/___FILEBASENAME___Worker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ___FILEHEADER___ | ||
|
||
import ReactiveSwift | ||
import Workflow | ||
import WorkflowReactiveSwift | ||
import WorkflowUI | ||
|
||
// MARK: Workers | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
struct ___VARIABLE_productName___Worker: Worker { | ||
enum Output {} | ||
|
||
func run() -> SignalProducer<Output, Never> { | ||
fatalError() | ||
} | ||
|
||
func isEquivalent(to otherWorker: ___VARIABLE_productName___Worker) -> Bool { | ||
return true | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...orkflow (Verbose).xctemplate/generateWorkerReactiveSwift/___FILEBASENAME___Workflow.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// ___FILEHEADER___ | ||
|
||
import Workflow | ||
import WorkflowUI | ||
|
||
// MARK: Input and Output | ||
|
||
struct ___VARIABLE_productName___Workflow: Workflow { | ||
enum Output {} | ||
} | ||
|
||
// MARK: State and Initialization | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
struct State {} | ||
|
||
func makeInitialState() -> ___VARIABLE_productName___Workflow.State { | ||
return State() | ||
} | ||
|
||
func workflowDidChange(from previousWorkflow: ___VARIABLE_productName___Workflow, state: inout State) {} | ||
} | ||
|
||
// MARK: Actions | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
enum Action: WorkflowAction { | ||
typealias WorkflowType = ___VARIABLE_productName___Workflow | ||
|
||
func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? { | ||
switch self { | ||
// Update state and produce an optional output based on which action was received. | ||
} | ||
} | ||
} | ||
} | ||
|
||
// MARK: Rendering | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
// TODO: Change this to your actual rendering type | ||
typealias Rendering = String | ||
|
||
func render(state: ___VARIABLE_productName___Workflow.State, context: RenderContext<___VARIABLE_productName___Workflow>) -> Rendering { | ||
#warning("Don't forget your render implementation and to return the correct rendering type!") | ||
return "This is likely not the rendering that you want to return" | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...plates/Workflow (Verbose).xctemplate/generateWorkerRxSwift/___FILEBASENAME___Worker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ___FILEHEADER___ | ||
|
||
import RxSwift | ||
import Workflow | ||
import WorkflowRxSwift | ||
import WorkflowUI | ||
|
||
// MARK: Workers | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
struct ___VARIABLE_productName___Worker: Worker { | ||
enum Output {} | ||
|
||
func run() -> Observable<Output> { | ||
fatalError() | ||
} | ||
|
||
func isEquivalent(to otherWorker: ___VARIABLE_productName___Worker) -> Bool { | ||
return true | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...ates/Workflow (Verbose).xctemplate/generateWorkerRxSwift/___FILEBASENAME___Workflow.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// ___FILEHEADER___ | ||
|
||
import Workflow | ||
import WorkflowUI | ||
|
||
// MARK: Input and Output | ||
|
||
struct ___VARIABLE_productName___Workflow: Workflow { | ||
enum Output {} | ||
} | ||
|
||
// MARK: State and Initialization | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
struct State {} | ||
|
||
func makeInitialState() -> ___VARIABLE_productName___Workflow.State { | ||
return State() | ||
} | ||
|
||
func workflowDidChange(from previousWorkflow: ___VARIABLE_productName___Workflow, state: inout State) {} | ||
} | ||
|
||
// MARK: Actions | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
enum Action: WorkflowAction { | ||
typealias WorkflowType = ___VARIABLE_productName___Workflow | ||
|
||
func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? { | ||
switch self { | ||
// Update state and produce an optional output based on which action was received. | ||
} | ||
} | ||
} | ||
} | ||
|
||
// MARK: Rendering | ||
|
||
extension ___VARIABLE_productName___Workflow { | ||
// TODO: Change this to your actual rendering type | ||
typealias Rendering = String | ||
|
||
func render(state: ___VARIABLE_productName___Workflow.State, context: RenderContext<___VARIABLE_productName___Workflow>) -> Rendering { | ||
#warning("Don't forget your render implementation and to return the correct rendering type!") | ||
return "This is likely not the rendering that you want to return" | ||
} | ||
} |