Skip to content

Commit a4ea101

Browse files
committed
feat: Add generic start method to Coordinator protocol
This allows calling no-parameter coordinators without knowing the concrete type
1 parent 0f5b7e3 commit a4ea101

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/LegacyReactor/Coordinator.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ import UIKit
2222
///Coordinator's root `UIViewController`
2323
var rootViewController: UIViewController? { get set }
2424

25+
/// Calls the default, parameter-less implementation of `start` function, returning the view controller
26+
/// this coordinator manages. This is useful when navigating to a coordinator of an unknown type,
27+
/// not requiring casting to a concrete type first.
28+
@discardableResult
29+
func start() -> UIViewController?
30+
2531
}
2632

2733
extension Coordinator {

0 commit comments

Comments
 (0)