Skip to content

Commit

Permalink
update all produce direct types (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidas-trafi authored Nov 24, 2023
1 parent f5de659 commit 9388a9e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/StoryFlow/Flow/ImplicitFlow/ImplicitFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ extension Flow {
}

// MARK: Direct Unwind
let directProduceType = Swift.type(of: value)

if let to = from.unwindVc(for: Swift.type(of: value)) {
to.handleUpdate(value, type)
let transition = TransitionInfo(from: from, producedType: output.type, receivedType: type, to: to, isUnwind: true)
if let to = from.unwindVc(for: directProduceType) {
to.handleUpdate(value, directProduceType)
let transition = TransitionInfo(from: from, producedType: directProduceType, receivedType: directProduceType, to: to, isUnwind: true)
if CustomTransition.attempt(transition) == false {
Transition.unwind().go(from, to)
}
Expand All @@ -79,8 +80,8 @@ extension Flow {

// MARK: Direct Input

if let to = Flow<Any>.destination(for: (value, Swift.type(of: value))) {
let transition = TransitionInfo(from: from, producedType: Swift.type(of: value), receivedType: type, to: to, isUnwind: false)
if let to = Flow<Any>.destination(for: (value, directProduceType)) {
let transition = TransitionInfo(from: from, producedType: directProduceType, receivedType: directProduceType, to: to, isUnwind: false)
if CustomTransition.attempt(transition) == false {
Transition.show(UIViewController.self).go(from, to)
}
Expand Down

0 comments on commit 9388a9e

Please sign in to comment.