diff --git a/Demo/Screens/Home/HomeScreen.swift b/Demo/Screens/Home/HomeScreen.swift index b7dda98..a39d60f 100644 --- a/Demo/Screens/Home/HomeScreen.swift +++ b/Demo/Screens/Home/HomeScreen.swift @@ -75,7 +75,6 @@ struct HomeScreen: View { dismissButton: .cancel()) } } - } private func presentDialog() { navigator.presentDialog(dismissOnTouchOutside: true) { diff --git a/SwiftUINavigator/Sources/SwiftUINavigator/Sheet/SheetManager.swift b/SwiftUINavigator/Sources/SwiftUINavigator/Sheet/SheetManager.swift index 4b98056..130baa6 100644 --- a/SwiftUINavigator/Sources/SwiftUINavigator/Sheet/SheetManager.swift +++ b/SwiftUINavigator/Sources/SwiftUINavigator/Sheet/SheetManager.swift @@ -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 } @@ -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, @@ -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 } } \ No newline at end of file