Skip to content

Commit

Permalink
💫 Update: RNIModalView
Browse files Browse the repository at this point in the history
Related:
* `TODO:2023-03-31-18-33-34` - Unify/streamline/consolidate logic for invoking modal focus/blur.
* `TODO:2023-04-06-02-13-24` - Update `RNIModalView` to use `RNIViewControllerLifeCycleNotifiable`.

Summary: WIP - Update `RNIModalView` to conform to `RNIViewControllerLifeCycleNotifiable`, and add placeholder/"no-op" methods.
  • Loading branch information
dominicstop committed Apr 6, 2023
1 parent 801af5d commit 3b8802c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
// ----------------------------------------
Expand Down

0 comments on commit 3b8802c

Please sign in to comment.