Skip to content

Commit

Permalink
Fix dimissing sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
MalekKamel committed Nov 22, 2022
1 parent d9f932d commit 9ea0178
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Demo/Screens/Home/HomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct HomeScreen: View {
dismissButton: .cancel())
}
}
}

private func presentDialog() {
navigator.presentDialog(dismissOnTouchOutside: true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SheetManager: ObservableObject {
height: 0,
isDismissable: false)
#if os(iOS)
private var fixedSheetPresenter: UIViewController? = nil
private var fixedSheetPresenter: FixedSheetPresenter = .rootController
#endif

}
Expand Down Expand Up @@ -108,7 +108,7 @@ extension SheetManager {

#if os(iOS)
case let .fixedHeight(type, isDismissable, presenter):
fixedSheetPresenter = presenter.controller
fixedSheetPresenter = presenter
presentFixedSheet(
height: type.height,
isDismissable: isDismissable,
Expand Down Expand Up @@ -165,8 +165,8 @@ extension SheetManager {

private func dismissFixedSheet() {
#if os(iOS)
fixedSheetPresenter?.dismiss(animated: false)
fixedSheetPresenter = nil
fixedSheetPresenter.controller?.dismiss(animated: false)
fixedSheetPresenter = .rootController
#endif
}
}

0 comments on commit 9ea0178

Please sign in to comment.