Skip to content

Commit

Permalink
💫 Update: Disable RNIModalView Modal Hiding
Browse files Browse the repository at this point in the history
Related:
* `TODO:2023-04-07-02-33-21` Refactor: Re-write "hide non-visible modal" logic (i.e. logic for temporarily hiding bottom-most  modals).
* `TODO:2023-04-07-02-39-15` - Disable `hideNonVisibleModals`-related logic from triggering.
  • Loading branch information
dominicstop committed Apr 6, 2023
1 parent 8561a04 commit 47429cc
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
.isEnabled = flag ?? self.enableSwipeGesture;
};

/// TODO:2023-03-22-12-07-54 - Refactor: Move to `RNIModalManager`
/// `TODO:2023-03-22-12-07-54`
/// * Refactor: Move to `RNIModalManager`
///
/// helper func to hide/show the other modals that are below level
private func setIsHiddenForViewBelowLevel(_ level: Int, isHidden: Bool){
Expand Down Expand Up @@ -495,12 +496,6 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
self.modalState.set(state: .PRESENTING_PROGRAMMATIC);

topMostPresentedVC.present(modalVC, animated: true) { [unowned self] in
/// `TODO:2023-04-07-02-39-15`
/// * Disable `hideNonVisibleModals`-related logic from triggering.
if self.hideNonVisibleModals {
self.setIsHiddenForViewBelowLevel(self.modalIndex - 1, isHidden: true);
};

// Reset swipe gesture before it was temporarily disabled
self.enableSwipeGesture();

Expand Down Expand Up @@ -576,15 +571,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
+ " - Start dismissing modal"
);
#endif

/// `TODO:2023-04-07-02-39-15`
/// * Disable `hideNonVisibleModals`-related logic from triggering.
///
/// begin temp. hiding modals that are no longer visible if needed
if self.hideNonVisibleModals {
self.setIsHiddenForViewBelowLevel(self.modalIndex, isHidden: false);
};


self.enableSwipeGesture(false);

/// set specific "dismissing" state
Expand Down Expand Up @@ -677,12 +664,6 @@ extension RNIModalView: UIAdaptivePresentationControllerDelegate {
func presentationControllerWillDismiss(_ presentationController: UIPresentationController) {
self.modalState.set(state: .DISMISSING_GESTURE);

/// `TODO:2023-04-07-02-39-15`
/// * Disable `hideNonVisibleModals`-related logic from triggering.
if self.hideNonVisibleModals {
self.setIsHiddenForViewBelowLevel(self.modalIndex, isHidden: false);
};

#if DEBUG
print(
"Log - RNIModalView+UIAdaptivePresentationControllerDelegate"
Expand Down

0 comments on commit 47429cc

Please sign in to comment.