Skip to content
Snippets Groups Projects
Commit 8cd52d10 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Merge branch 'fix/drawers-scrolling' into 'dev'

Fix scrolling of drawers

See merge request elixxir/client-ios!101
parents b6db0f19 17b1cc03
Branches
No related tags found
1 merge request!101Fix scrolling of drawers
import UIKit
import ScrollViewController
/// Opens up `Drawer` on a given parent view controller
public struct PresentDrawer: Action {
......@@ -35,7 +36,7 @@ public struct PresentDrawer: Action {
/// Performs `PresentDrawer` action
public struct PresentDrawerNavigator: TypedNavigator {
/// Custom transitioning delegate
let transitioningDelegate = BottomTransitioningDelegate()
let transitioningDelegate = FullscreenTransitioningDelegate()
/// View controller which should be opened up
var viewController: ([Any]) -> UIViewController
......@@ -47,13 +48,19 @@ public struct PresentDrawerNavigator: TypedNavigator {
}
public func perform(_ action: PresentDrawer, completion: @escaping () -> Void) {
transitioningDelegate.isDismissableOnBackgroundTouch = action.isDismissable
let scrollViewController = ScrollViewController()
let controller = viewController(action.items)
controller.transitioningDelegate = transitioningDelegate
controller.modalPresentationStyle = .overFullScreen
scrollViewController.addChild(controller)
scrollViewController.contentView = controller.view
scrollViewController.wrapperView.handlesTouchesOutsideContent = !action.isDismissable
scrollViewController.wrapperView.alignContentToBottom = true
scrollViewController.scrollView.bounces = false
controller.didMove(toParent: scrollViewController)
scrollViewController.transitioningDelegate = transitioningDelegate
scrollViewController.modalPresentationStyle = .overFullScreen
action.parent.present(
controller,
scrollViewController,
animated: action.animated,
completion: completion
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment