MimiUserFlow
open class MimiUserFlow : NSObject, MimiThemeable, FlowPresentationControllerHandlerDelegate
A sequential flow of ‘steps’ which correspond to visible view controllers on screen.
-
Number of steps in the flow.
Declaration
Swift
public var count: Int { get }
-
Index of the currently selected step in the flow.
Declaration
Swift
public var currentIndex: Int? { get }
-
Object that acts as a delegate to the user flow.
Declaration
Swift
public weak var delegate: MimiUserFlowDelegate?
-
Presentation style to use if flow is presented modally.
Declaration
Swift
public var modalPresentationStyle: UIModalPresentationStyle?
-
Transition style to use if flow is presented modally.
Declaration
Swift
public var modalTransitionStyle: UIModalTransitionStyle?
-
Object that acts as a transitioning delegate to the view controller if the flow is presented.
Declaration
Swift
public weak var transitioningDelegate: UIViewControllerTransitioningDelegate?
-
Type of UINavigationBar to use if presented.
Declaration
Swift
open var navigationBarClass: UINavigationBar.Type? { get }
-
Parent user flow that pushed this flow as a child.
Declaration
Swift
open internal(set) weak var parent: MimiUserFlow? { get }
-
View Controller that is the root of the flow.
This view controller will be persistent for the whole lifecycle of the flow when set. Suitable for use as a presentingViewController.
Declaration
Swift
open weak private(set) var rootViewController: UIViewController? { get }
-
User flow will appear.
Declaration
Swift
open func willAppear(animated: Bool)
Parameters
animated
Whether the appearance will be animated.
-
User flow did appear.
Declaration
Swift
open func didAppear(animated: Bool)
Parameters
animated
Whether the appearance will be animated.
-
User flow will be dismissed.
Declaration
Swift
open func willDismiss(animated: Bool)
Parameters
animated
Whether the dismissal will be animated.
-
User flow was dismissed.
Declaration
Swift
open func didDismiss(animated: Bool)
Parameters
animated
Whether the dismissal was animated.
-
Add a step to the user flow.
Declaration
Swift
public func step(_ step: MimiUserFlowSteppable) -> Self
Parameters
step
Step to add.
-
Add a step to the user flow depending on a boolean decision.
Declaration
Swift
public func step(_ step: MimiUserFlowSteppable, if decision: @escaping () -> Bool) -> Self
Parameters
step
Step to add.
decision
Decision logic.
-
Add a step or another candidate to the user flow depending on a decision.
Declaration
Swift
public func step(_ step: MimiUserFlowSteppable, or other: MimiUserFlowSteppable, decision: @escaping (MimiUserFlowSteppable, MimiUserFlowSteppable) -> MimiUserFlowSteppable?) -> Self
Parameters
step
First step candidate.
other
Secondary step candidate.
decision
Decision logic.
-
Push a flow into an existing navigation controller.
Declaration
Swift
open func push(in navigationController: UINavigationController?, animated: Bool)
Parameters
navigationController
The navigation controller to push into.
animated
Whether to animate the push.
-
Create the view controller which contains the flow.
Note: This view controller will internally manage navigation and should not really be embedded within another navigation controller.
Declaration
Swift
open func makeFlowViewController() throws -> UIViewController
Return Value
Flow view controller.
-
Present a flow from a view controller.
Declaration
Swift
open func present(from presentingviewController: UIViewController, animated: Bool, completion: (() -> Void)?)
Parameters
presentingviewController
View controller to present from.
animated
Whether to animate the presentation.
completion
Completion of the presentation.
-
Add the flow as a child view controller of another view controller.
Note
If you pass
nil
as thelayout
paramter, the view controller will be constrained to all edge anchors of the parent view controller.Declaration
Swift
open func addAsChild(to viewController: UIViewController, layout: ((_ parent: UIViewController, _ view: UIView) -> Void)? = nil)
Parameters
viewController
View controller to add as child to.
layout
Closure to execute custom layout logic.
-
Dismiss the flow if visible.
Declaration
Swift
open func dismiss(animated: Bool, completion: (() -> Void)?)
Parameters
animated
Whether to animate the dismissal.
completion
Completion of the dismissal.
-
Interaction controller to use with a custom animation controller.
Declaration
Swift
open func interactionController(for animationController: UIViewControllerAnimatedTransitioning, in navigationController: UINavigationController) -> UIViewControllerInteractiveTransitioning?
Parameters
animationController
Animation controller.
navigationController
Navigation controller.
Return Value
Custom interaction controller to use.