Skip to content

Commit

Permalink
💫 Update: getPresentedViewControllers
Browse files Browse the repository at this point in the history
Summary: Update `RNIModalManager.getPresentedViewControllers`.
  • Loading branch information
dominicstop committed Apr 6, 2023
1 parent 54e8f8e commit c3d62d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ios/src_library/React Native/RNIModal/RNIModalManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ public class RNIModalManager {
var presentedVCList: [UIViewController] = [rootVC];

// climb the vc hierarchy to find the topmost presented vc
while presentedVCList.last!.presentedViewController != nil {
if let presentedVC = presentedVCList.last!.presentedViewController {
presentedVCList.append(presentedVC);
};
while true {
guard let topVC = presentedVCList.last,
let presentedVC = topVC.presentedViewController
else { break };

presentedVCList.append(presentedVC);
};

return presentedVCList;
Expand Down

0 comments on commit c3d62d2

Please sign in to comment.