Skip to content

Commit

Permalink
Add chained hiding in UIViewController's ModalPresenter implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Elviro Rocca committed Feb 9, 2018
1 parent ae707e0 commit 397c629
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NavigationHelperUIKit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ extension UIViewController: ModalPresenter {

public func hide(animated: Bool) -> Future<()> {
if let lastModalPresented = self.lastModalPresented, let shownPresenter = lastModalPresented as? ModalPresenter, shownPresenter.isPresenting {
return shownPresenter.hide(animated: animated)
return shownPresenter.hide(animated: animated).flatMap {
self.hide(animated: animated)
}
}

return Future<()>.unfold { done in
Expand Down

0 comments on commit 397c629

Please sign in to comment.