Enhance the VectorHostingController to be presented as a bottom sheet (#6377)

* Enhance the VectorHostingController to be presented as a bottom sheet

- Done
This commit is contained in:
Gil Eluard
2022-07-05 12:18:10 +02:00
committed by GitHub
parent fc91a3a995
commit f927643469
3 changed files with 132 additions and 3 deletions
@@ -25,12 +25,17 @@ class VectorHostingController: UIHostingController<AnyView> {
// MARK: Private
var isNavigationBarHidden: Bool = false
var hidesBackTitleWhenPushed: Bool = false
private var theme: Theme
// MARK: Public
/// Wether or not the navigation bar should be hidden. Default `false`
var isNavigationBarHidden: Bool = false
/// Wether or not the title of the back item should be hidden. Default `false`
var hidesBackTitleWhenPushed: Bool = false
/// Defines the behaviour of the `VectorHostingController` as a bottom sheet. Default `nil`
var bottomSheetPreferences: VectorHostingBottomSheetPreferences?
/// Whether or not to use the iOS 15 style scroll edge appearance when the controller has a navigation bar.
var enableNavigationBarScrollEdgeAppearance = false
/// When non-nil, the style will be applied to the status bar.
@@ -58,6 +63,8 @@ class VectorHostingController: UIHostingController<AnyView> {
self.registerThemeServiceDidChangeThemeNotification()
self.update(theme: self.theme)
bottomSheetPreferences?.setup(viewController: self)
}
override func viewWillAppear(_ animated: Bool) {