Skip to content

Commit c43fa72

Browse files
committed
Update README
1 parent b1cee17 commit c43fa72

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Diff for: README.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ See the provided examples for help or feel free to ask directly.
6565
- [Presenting an overlay container](#presenting-an-overlay-container)
6666
- [Enabling & disabling notches](#enabling--disabling-notches)
6767
- [Backdrop view](#backdrop-view)
68-
- [Safe Area](#safe-area)
68+
- [Safe Area issues](#safe-area-issues)
6969
- [Custom Translation](#custom-translation)
7070
- [Custom Translation Animations](#custom-translation-animations)
7171
- [Reloading the notches](#reloading-the-notches)
72+
- [SwiftUI](#swiftui)
7273
- [Author](#author)
7374
- [License](#license)
7475

@@ -452,11 +453,11 @@ func overlayContainerViewController(_ containerViewController: OverlayContainerV
452453
}
453454
```
454455

455-
### Safe Area
456+
### Safe Area issues
456457

457-
Be careful when using safe areas. As described in the [WWDC "UIKit: Apps for Every Size and Shape" video](https://masterer.apple.com/videos/play/wwdc2018-235/?time=328), the safe area insets will not be updated if your views exceeds the screen bounds. This is specially the case when using the `OverlayStyle.flexibleHeight`.
458+
Be careful when using safe areas. As described in the [WWDC "UIKit: Apps for Every Size and Shape" video](https://masterer.apple.com/videos/play/wwdc2018-235/?time=328), the safe area insets will not be updated if your views exceeds the screen bounds. This is specially the case when using the `OverlayStyle.expandableHeight`: when the overlay exceeds the bottom screen limit, its safe area will not be updated.
458459

459-
The simpliest way to handle the safe area correctly is to compute your notch heights using the `safeAreaInsets` provided by the container and avoid the `safeAreaLayoutGuide` bottom anchor in your overlay:
460+
The simpliest way to handle the safe area correctly is to compute your notch heights using the `safeAreaInsets` of the container and avoid the `safeAreaLayoutGuide` use in your overlay view:
460461

461462
```swift
462463
func overlayContainerViewController(_ containerViewController: OverlayContainerViewController,
@@ -473,6 +474,8 @@ func overlayContainerViewController(_ containerViewController: OverlayContainerV
473474
}
474475
```
475476

477+
If you depend on `UIKit` native components that do not ignore the safe area like a `UINavigationBar`, use the `OverlayStyle.flexibleHeight` style.
478+
476479
### Custom Translation
477480

478481
Adopt `OverlayTranslationFunction` to modify the relation between the user's finger translation and the actual overlay translation.
@@ -528,6 +531,10 @@ func invalidateNotchHeights()
528531
This method does not reload the notch heights immediately. It only clears the current container's state. Because the number of notches may change, the container will use its target notch policy to determine where to go.
529532
Call `moveOverlay(toNotchAt:animated:)` to override this behavior.
530533

534+
## SwiftUI
535+
536+
See [DynamicOverlay](https://github.com/faberNovel/DynamicOverlay)
537+
531538
## Author
532539

533540
[@gaetanzanella](https://twitter.com/gaetanzanella), gaetan.zanella@fabernovel.com

0 commit comments

Comments
 (0)