Skip to content

Commit

Permalink
Dismiss controller in NavManager.dismissSheet()
Browse files Browse the repository at this point in the history
  • Loading branch information
MalekKamel committed May 27, 2022
1 parent a6fc76a commit 93304a2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SwiftUINavigator/Sources/SwiftUINavigator/NavManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ extension NavManager {
root?.presentFullSheet = false
root?.presentCustomSheet = false
root?.sheet = nil
dismissController()
}

public func dismiss(
Expand All @@ -259,10 +260,7 @@ extension NavManager {
}

public func dismiss(to destination: DismissDestination) {
#if os(iOS)
// For dismissing the custom sheet which is displayed in a controller
UIApplication.shared.topController?.dismiss(animated: true)
#endif
dismissController()

lastNavigationType = .pop

Expand All @@ -285,6 +283,12 @@ extension NavManager {
}
}

private func dismissController() {
#if os(iOS)
// For dismissing the custom sheet which is displayed in a controller
UIApplication.shared.topController?.dismiss(animated: true)
#endif
}
}

extension NavManager {
Expand Down

0 comments on commit 93304a2

Please sign in to comment.