We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75cb7d6 commit 25c4dbcCopy full SHA for 25c4dbc
1 file changed
Sources/StoryFlow/Flow/ImplicitFlow/ImplicitFlow.swift
@@ -36,12 +36,15 @@ extension Flow {
36
37
extension Flow {
38
39
+ private class _VoidOutputTypeProducing: UIViewController, OutputProducing {
40
+ typealias OutputType = Void
41
+ }
42
+
43
public static func implicit() -> Flow {
44
return Flow { from, value in
45
- guard let outputProducing = from as? _AnyOutputProducing
- else { fatalError("Can't use `Flow.implict()` on vc that is not `OutputProducing` for produced `output` \(value) from `\(Swift.type(of: from))`.") }
-
46
+ let outputProducing = from as? _AnyOutputProducing ?? _VoidOutputTypeProducing()
47
48
let output = OutputTransform.unwrapOneOfN((value, Swift.type(of: outputProducing)._outputType))
49
let (value, type) = OutputTransform.apply(output)
50
0 commit comments