From 6cb35bccb6588f5576662f18ae9e6b5f36f898d2 Mon Sep 17 00:00:00 2001 From: closure11 Date: Wed, 4 Sep 2024 09:07:50 +0800 Subject: [PATCH] Replace deprecated bottomLayoutGuide --- PanModal/Controller/PanModalPresentationController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PanModal/Controller/PanModalPresentationController.swift b/PanModal/Controller/PanModalPresentationController.swift index 11fb2a6e..05e3e6a6 100644 --- a/PanModal/Controller/PanModalPresentationController.swift +++ b/PanModal/Controller/PanModalPresentationController.swift @@ -454,7 +454,11 @@ private extension PanModalPresentationController { Set the appropriate contentInset as the configuration within this class offsets it */ - scrollView.contentInset.bottom = presentingViewController.bottomLayoutGuide.length + if #available(iOS 11.0, *) { + scrollView.contentInset.bottom = presentingViewController.view.safeAreaInsets.bottom + } else { + scrollView.contentInset.bottom = presentingViewController.bottomLayoutGuide.length + } /** As we adjust the bounds during `handleScrollViewTopBounce`