From 80f75949da5957ef09ca674afd703aaeecdf61be Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Fri, 27 Sep 2024 20:32:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20`RNIModalSheetViewCont?= =?UTF-8?q?roller`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/RNIModalSheetView/RNIModalSheetViewController.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ios/RNIModalSheetView/RNIModalSheetViewController.swift b/ios/RNIModalSheetView/RNIModalSheetViewController.swift index c583287b..d49f909a 100644 --- a/ios/RNIModalSheetView/RNIModalSheetViewController.swift +++ b/ios/RNIModalSheetView/RNIModalSheetViewController.swift @@ -6,6 +6,7 @@ // import UIKit +import DGSwiftUtilities import react_native_ios_utilities #if !RCT_NEW_ARCH_ENABLED @@ -13,7 +14,7 @@ import React #endif -open class RNIModalSheetViewController: UIViewController { +open class RNIModalSheetViewController: ModalSheetViewControllerLifecycleNotifier { public var shouldTriggerDefaultCleanup = true; @@ -43,6 +44,7 @@ open class RNIModalSheetViewController: UIViewController { // --------------------------------- public override func viewDidLoad() { + super.viewDidLoad(); guard let mainSheetContentParent = self.mainSheetContentParent, let mainSheetContent = mainSheetContentParent.contentDelegate as? RNIWrapperViewContent @@ -90,7 +92,9 @@ open class RNIModalSheetViewController: UIViewController { }; }; - public override func viewDidLayoutSubviews() { + public override func viewWillLayoutSubviews() { + super.viewWillLayoutSubviews(); + guard let mainSheetContentParent = self.mainSheetContentParent else { return; };