Skip to content

Commit

Permalink
Fix view controller which’s being dismissed (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailmaslo authored Jul 28, 2023
1 parent fcad2cf commit 375cc24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public final class DefaultBottomSheetModalDismissalHandler: BottomSheetModalDism
}

public func performDismissal(animated: Bool) {
if let presentedViewController = presentingViewController {
if let presentedViewController = presentingViewController?.presentedViewController {
presentedViewController.dismiss(animated: animated, completion: dismissCompletion)
} else {
// User dismissed view controller by swipe-gesture, dismiss handler wasn't invoked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public final class BottomSheetPresentationController: UIPresentationController {
private func startInteractiveTransition() {
interactionController = UIPercentDrivenInteractiveTransition()

presentingViewController.dismiss(animated: true) { [weak self] in
presentedViewController.dismiss(animated: true) { [weak self] in
guard let self = self else { return }

if self.presentingViewController.presentedViewController !== self.presentedViewController {
Expand Down

0 comments on commit 375cc24

Please sign in to comment.