Skip to content

Commit

Permalink
Dismiss modal view controller in ModalRootViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
RyosukeCla committed Jun 4, 2024
1 parent fe80c5e commit 688601d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ios/Nativebrik/Nativebrik/component/root.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ModalRootViewController: UIViewController {
return page.data?.kind == PageKind.TRIGGER
}
self.modalViewController = modalViewController
self.modalViewController?.dismissModal()
self.container = container
super.init(nibName: nil, bundle: nil)

Expand Down Expand Up @@ -235,6 +236,9 @@ class RootView: UIView {

func findTopPresenting(_ viewContorller: UIViewController) -> UIViewController {
if let presented = viewContorller.presentedViewController {
if presented.isBeingDismissed {
return viewContorller
}
return findTopPresenting(presented)
} else {
return viewContorller
Expand Down

0 comments on commit 688601d

Please sign in to comment.