Skip to content

Commit

Permalink
Merge pull request #37 from allaboutapps/bugfix/dismissChildCoordinat…
Browse files Browse the repository at this point in the history
…or-completion

Fixed dismissChildCoordinator not calling completion closure if no Coordinator is to be dismissed
  • Loading branch information
mbuchetics committed Jun 5, 2023
2 parents 0636b6d + bab7217 commit 8ca5a13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Toolbox/Coordinators/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ open class Coordinator: NSObject {
}

public func dismissChildCoordinator(animated: Bool, completion: (() -> Void)? = nil) {
guard let coordinator = childCoordinators.first(where: { $0.rootViewController.presentingViewController != nil }) else { return }
guard let coordinator = childCoordinators.first(where: { $0.rootViewController.presentingViewController != nil })
else {
completion?()
return
}

print("dismiss coordinator")

Expand Down

0 comments on commit 8ca5a13

Please sign in to comment.