Skip to content

Commit

Permalink
💫 Update: RNIModal+Helpers
Browse files Browse the repository at this point in the history
Related:
* TODO:2023-03-04-15-39-46 - Impl. `RNIModalManager`.
  • Loading branch information
dominicstop committed Mar 24, 2023
1 parent 54221c4 commit a0bf812
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ios/src_library/React Native/RNIModal/RNIModal+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ extension RNIModalState where Self: RNIModalPresentation {
RNIModalManager.getPresentedViewControllers(for: self.window);

return listPresentedVC.contains {
$0 === self;
$0 === self.modalViewController;
};
};

/// Programmatically check if this instance is in focus
var synthesizedIsModalInFocus: Bool? {
var synthesizedIsModalInFocus: Bool {
let listPresentedVC =
RNIModalManager.getPresentedViewControllers(for: self.window);

guard let topmostVC = listPresentedVC.last
else { return self.isModalInFocus };

guard let topmostVC = listPresentedVC.last else { return nil };
return topmostVC === self.modalViewController;
};
};

0 comments on commit a0bf812

Please sign in to comment.