Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xx messenger iOS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
xx messenger iOS
Commits
17b1cc03
Commit
17b1cc03
authored
2 years ago
by
Bruno Muniz
Browse files
Options
Downloads
Patches
Plain Diff
Fix scrolling of drawers
parent
b6db0f19
No related branches found
Branches containing commit
No related tags found
1 merge request
!101
Fix scrolling of drawers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/AppNavigation/PresentDrawer.swift
+12
-5
12 additions, 5 deletions
Sources/AppNavigation/PresentDrawer.swift
with
12 additions
and
5 deletions
Sources/AppNavigation/PresentDrawer.swift
+
12
−
5
View file @
17b1cc03
import
UIKit
import
UIKit
import
ScrollViewController
/// Opens up `Drawer` on a given parent view controller
/// Opens up `Drawer` on a given parent view controller
public
struct
PresentDrawer
:
Action
{
public
struct
PresentDrawer
:
Action
{
...
@@ -35,7 +36,7 @@ public struct PresentDrawer: Action {
...
@@ -35,7 +36,7 @@ public struct PresentDrawer: Action {
/// Performs `PresentDrawer` action
/// Performs `PresentDrawer` action
public
struct
PresentDrawerNavigator
:
TypedNavigator
{
public
struct
PresentDrawerNavigator
:
TypedNavigator
{
/// Custom transitioning delegate
/// Custom transitioning delegate
let
transitioningDelegate
=
Bottom
TransitioningDelegate
()
let
transitioningDelegate
=
Fullscreen
TransitioningDelegate
()
/// View controller which should be opened up
/// View controller which should be opened up
var
viewController
:
([
Any
])
->
UIViewController
var
viewController
:
([
Any
])
->
UIViewController
...
@@ -47,13 +48,19 @@ public struct PresentDrawerNavigator: TypedNavigator {
...
@@ -47,13 +48,19 @@ public struct PresentDrawerNavigator: TypedNavigator {
}
}
public
func
perform
(
_
action
:
PresentDrawer
,
completion
:
@escaping
()
->
Void
)
{
public
func
perform
(
_
action
:
PresentDrawer
,
completion
:
@escaping
()
->
Void
)
{
transitioningDelegate
.
isDismissableOnBackgroundTouch
=
action
.
isDismissable
let
scrollViewController
=
ScrollViewController
()
let
controller
=
viewController
(
action
.
items
)
let
controller
=
viewController
(
action
.
items
)
controller
.
transitioningDelegate
=
transitioningDelegate
scrollViewController
.
addChild
(
controller
)
controller
.
modalPresentationStyle
=
.
overFullScreen
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
(
action
.
parent
.
present
(
c
ontroller
,
scrollViewC
ontroller
,
animated
:
action
.
animated
,
animated
:
action
.
animated
,
completion
:
completion
completion
:
completion
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment