Skip to content

Commit

Permalink
💄 Gloss: Update Comments
Browse files Browse the repository at this point in the history
Update RNIModalView.swift
  • Loading branch information
dominicstop committed Mar 22, 2023
1 parent cc4441a commit b4e289a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class RNIModalView: UIView {
}
};

// TODO: 2023-03-22-11-33-06 - Add `synthesized-` prefix
private var _modalPresentationStyle: UIModalPresentationStyle = {
// Provide default value
guard #available(iOS 13.0, *) else { return .overFullScreen };
Expand Down Expand Up @@ -165,6 +166,7 @@ class RNIModalView: UIView {
}
};

// TODO: 2023-03-22-11-33-06 - Add `synthesized-` prefix
private var _modalTransitionStyle: UIModalTransitionStyle = .coverVertical;
@objc var modalTransitionStyle: NSString = "coverVertical" {
didSet {
Expand Down Expand Up @@ -371,6 +373,8 @@ class RNIModalView: UIView {
}();
};

/// TODO:2023-03-22-12-18-37 - Refactor: Remove `deinitControllers`
/// * Refactor so that we don't have to constantly cleanup...
private func deinitControllers(){
#if DEBUG
print("RNIModalView init - deinitControllers for modal: \(self.modalID ?? self.modalUUID as NSString)");
Expand Down Expand Up @@ -444,6 +448,8 @@ class RNIModalView: UIView {
.isEnabled = flag ?? self.enableSwipeGesture;
};


/// 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){
let presentedVCList = self.getPresentedVCList();
Expand All @@ -458,6 +464,9 @@ class RNIModalView: UIView {
// MARK: - Functions - Internal
// ----------------------------

/// TODO:2023-03-22-12-09-34 - Move to `get` property called
/// `synthesizedNativeEventBase`
///
/// helper function to create a `NativeEvent` object
func createModalNativeEventDict() -> Dictionary<AnyHashable, Any> {
var dict: Dictionary<AnyHashable, Any> = [
Expand Down Expand Up @@ -545,13 +554,15 @@ class RNIModalView: UIView {
);
#endif

// Temporarily disable swipe gesture while it's being presented
self.enableSwipeGesture(false);

topMostPresentedVC.present(modalNVC, animated: true) {
if self.hideNonVisibleModals {
self.setIsHiddenForViewBelowLevel(self.modalLevel - 1, isHidden: true);
};

// Reset swipe gesture before it was temporarily disabled
self.enableSwipeGesture();
self.delegate?.onPresentModalView(modalView: self);

Expand Down Expand Up @@ -594,6 +605,7 @@ class RNIModalView: UIView {
return;
};

/// TODO:2023-03-22-12-12-05 - Remove?
let presentedVC: UIViewController = isModalInFocus
? modalVC
: modalVC.presentingViewController!
Expand Down

0 comments on commit b4e289a

Please sign in to comment.