Last active
August 30, 2018 04:42
-
-
Save CyrilCermak/88abf20215df62766f8da3a172d13c0c to your computer and use it in GitHub Desktop.
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
/** | |
Every child flow must implement Flow protocol | |
- func start: Starts the flow process, it usually decides what is | |
going to be presented | |
- var services: Property that contains all the services that are | |
being used in the app | |
- var finish: Is a closure that notifies parent Flow | |
that the child flow is finished. | |
- var currentVC: Returns view controller that is currently being displayed | |
*/ | |
public protocol Flow { | |
init(services: Services, navigationVC: UINavigationController?) | |
func start() | |
var services: Services { get } | |
var finish: (_ flow: Flow) -> () { get set } | |
var navigation: UINavigationController? { get set } | |
var currentVC: UIViewController? { get } | |
} | |
extension Flow { | |
public var currentVC: UIViewController? { | |
return navigation?.viewControllers.last | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment