Skip to content

Commit

Permalink
🛠 Refactor: Cleanup RNIModalViewManager
Browse files Browse the repository at this point in the history
Related:
* `TODO:2023-03-04-15-38-02` - **Refactor**: Remove `RNIModalViewManager.currentModalLevel`.
* `TODO:2023-03-04-15-33-15` - **Refactor**: Remove `RNIModalViewManager.delegatesFocus`.
* Remove `RNIModalViewManager.presentedModalRefs`.
  • Loading branch information
dominicstop committed Mar 27, 2023
1 parent 5d89ddb commit 159d4d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,9 @@ class RNIModalViewManager: RCTViewManager {
override static func requiresMainQueueSetup() -> Bool {
return true;
};

/// TODO:2023-03-24-14-25-52 - Remove `RNIModalViewFocusDelegate`-related
/// logic
///
// TODO: See TODO:2023-03-04-15-49-02 - Refactor: Relocate
//`presentedModalRefs`
//
// * a weak ref to the currently presented modals.
// * currently unused, remove later.
var presentedModalRefs = NSMapTable<NSString, RNIModalView>.init(
keyOptions : .copyIn,
valueOptions: .weakMemory
);

// TODO: See `TODO:2023-03-04-15-33-15` - Refactor: Relocate
// `delegatesFocus`
var delegatesFocus = MulticastDelegate<AnyObject>();

// TODO: See TODO:2023-03-04-15-38-02 - Refactor: Relocate
// `currentModalLevel`
private var currentModalLevel = -1;

override func view() -> UIView! {
let view = RNIModalView(bridge: self.bridge);
self.delegatesFocus.add(view);

return view;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ extension RNIModalViewModule {

// modal dismissed
completion();

let manager = RNIModalViewManager.sharedInstance;
manager?.presentedModalRefs.removeObject(forKey: modalRef.modalNativeID! as NSString);
};

} else {
Expand Down

0 comments on commit 159d4d5

Please sign in to comment.