Skip to content

Commit

Permalink
[removedAfterProceeding] - Adding documentation to complete on UIKite…
Browse files Browse the repository at this point in the history
…Presenter - MOB
  • Loading branch information
Richard-Gist committed Jun 9, 2021
1 parent e8824ea commit a90d7ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/WorkflowUIKit/UIKitPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ open class UIKitPresenter: OrchestrationResponder {
abandon(workflow, animated: true, onFinish: onFinish)
}

/**
Completes the workflow, making the callback at the appropriate time for UIKit.
### Discussion
If the last view of the workflow has a persistence of `.removedAfterProceeding`, then the view will be removed before completing.
- Important: `complete` is called when proceeding through the last view of the ``Workflow``.
- Parameter workflow: ``AnyWorkflow`` being completed.
- Parameter passedArgs: arguments to pass to `onFinish`.
- Parameter onFinish: closure provided when launching `workflow`.
*/
public func complete(_ workflow: AnyWorkflow, passedArgs: AnyWorkflow.PassedArgs, onFinish: ((AnyWorkflow.PassedArgs) -> Void)?) {
let lastInstance = workflow.last { $0.value.instance != nil }

Expand Down

0 comments on commit a90d7ef

Please sign in to comment.