diff --git a/ios/src_library/React Native/RNIModalView/RNIModalView.swift b/ios/src_library/React Native/RNIModalView/RNIModalView.swift index dc9caa2c..5e8c7514 100644 --- a/ios/src_library/React Native/RNIModalView/RNIModalView.swift +++ b/ios/src_library/React Native/RNIModalView/RNIModalView.swift @@ -338,7 +338,9 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying, self.modalVC = { let vc = RNIModalViewController(); + vc.modalViewRef = self; + vc.lifecycleDelegate = self; vc.isBGBlurred = self.isModalBGBlurred; vc.isBGTransparent = self.isModalBGTransparent; @@ -751,6 +753,25 @@ extension RNIModalView: RNIModalRequestable { }; }; +extension RNIModalView: RNIViewControllerLifeCycleNotifiable { + + func viewWillAppear(sender: UIViewController, animated: Bool) { + guard sender.isBeingPresented else { return }; + }; + + func viewDidAppear(sender: UIViewController, animated: Bool) { + guard sender.isBeingPresented else { return }; + }; + + func viewWillDisappear(sender: UIViewController, animated: Bool) { + guard sender.isBeingDismissed else { return }; + }; + + func viewDidDisappear(sender: UIViewController, animated: Bool) { + guard sender.isBeingDismissed else { return }; + }; +}; + // MARK: Extension: RNIModalFocusNotifiable // ----------------------------------------