From a90d7efc3d6d60e1e6f72123ef9ce03126e3b0ee Mon Sep 17 00:00:00 2001 From: Richard Gist Date: Wed, 9 Jun 2021 10:24:01 -0600 Subject: [PATCH] [removedAfterProceeding] - Adding documentation to complete on UIKitePresenter - MOB --- Sources/WorkflowUIKit/UIKitPresenter.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sources/WorkflowUIKit/UIKitPresenter.swift b/Sources/WorkflowUIKit/UIKitPresenter.swift index ff1db5a8d..9e6012109 100644 --- a/Sources/WorkflowUIKit/UIKitPresenter.swift +++ b/Sources/WorkflowUIKit/UIKitPresenter.swift @@ -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 }