Closed ivopintodasilva closed 3 years ago
Hi @ivopintodasilva, thank u very much for this detailed PR!
I prefer the dynamicOverlay
modifier approach but it looks its dead end for nowโฆ I commented your PR.
I should add a CI action.
Done, please rebase on top of the main branch
I decided to manage the background in the container view controller directly. It should fix the original issue.
Hello ๐ First of all, thanks a lot for creating and maintaining this library! ๐
Problem
The issue is described in #2 and #3. When having an overlay view, we are not able to tap or drag the background view.
Solution
Picking up on @matthewcheok's investigation, I created an extra view controller to wrap both the background and overlay views. This way, SwiftUI does not generate the view (between the background and overlay) that prevents gestures from getting to the background view.
In the video below we can see the proposed solution working. It's composed of a view that has one
List
as the background and another one as the overlay. The video shows that it is possible with this solution to tap and drag the list in the background view as well as maintaining the current overlay behavior.https://user-images.githubusercontent.com/4477378/110162963-b6a73800-7def-11eb-93b5-014790818efd.mov
Description
BackgroundAndOverlayContainerViewController
to add the background view to the overlay containerOverlayContainerDynamicOverlayView
to accept the background viewdynamicOverlay
modifier to make user explicitly inject the background viewList
elements andNotch
behaviorsIf this approach seems sensible to you, I can maybe improve
OverlayContainerDynamicOverlayView
's naming (or wrap it in a different SwiftUI view) to make it more usable from the caller's perspective and place in thePublic
folder.EDIT: Added
DynamicOverlay
public wrapper SwiftUI component.Let me know if you have other suggestions as well ๐