Skip to content

Commit

Permalink
🛠 Refactor:Use RNIModalState.modalNativeID
Browse files Browse the repository at this point in the history
Summary: Replace `RNIModal.synthesizedStringID` usage w/ `RNIModalState.modalNativeID`.
  • Loading branch information
dominicstop committed Mar 31, 2023
1 parent 0e4d7b2 commit aea42d7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions ios/src_library/React Native/RNIModal/RNIModal+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ extension RNIModalState where Self: RNIModalPresentation {
extension RNIModalState where Self: RNIModal {

var synthesizedModalData: RNIModalData {
RNIModalData(
modalNativeID: self.synthesizedStringID,
return RNIModalData(
modalNativeID: self.modalNativeID,
modalIndex: self.modalIndex,
currentModalIndex: RNIModalManagerShared.currentModalIndex,
isModalPresented: self.isModalPresented,
Expand Down
52 changes: 26 additions & 26 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.synthesizedModalPresentationStyle"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Unable to parse presentation style string"
+ " - modalPresentationStyle: '\(self.modalPresentationStyle)'"
+ " - using default style: '\(defaultStyle)'"
Expand All @@ -190,7 +190,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.synthesizedModalPresentationStyle"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Unsupported presentation style string value"
+ " - modalPresentationStyle: '\(self.modalPresentationStyle)'"
+ " - Using default style: '\(defaultStyle)'"
Expand All @@ -210,7 +210,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.synthesizedModalTransitionStyle "
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Unable to parse string value"
+ " - modalPresentationStyle: '\(self.modalPresentationStyle)'"
+ " - Using default style: '\(defaultStyle)'"
Expand All @@ -235,7 +235,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.synthesizedModalBGBlurEffectStyle"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Unable to parse string value"
+ " - modalPresentationStyle: '\(self.modalPresentationStyle)'"
+ " - Using default style: '\(defaultStyle)'"
Expand Down Expand Up @@ -334,7 +334,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Log - RNIModalView.initControllers"
+ " - self.synthesizedStringID: '\(self.synthesizedStringID)'"
+ " - self.modalNativeID: '\(self.modalNativeID)'"
);
#endif

Expand All @@ -355,7 +355,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Log - RNIModalView.deinitControllers"
+ " - self.synthesizedStringID: '\(self.synthesizedStringID)'"
+ " - self.modalNativeID: '\(self.modalNativeID)'"
);
#endif

Expand Down Expand Up @@ -392,7 +392,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.presentModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Guard check failed: no window"
);
#endif
Expand All @@ -404,7 +404,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.presentModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Guard check failed: modal already presented"
);
#endif
Expand All @@ -419,7 +419,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.presentModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Guard check failed: could not get topMostPresentedVC"
);
#endif
Expand All @@ -431,7 +431,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.presentModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Guard check failed: Could not get modalVC"
);
#endif
Expand Down Expand Up @@ -464,7 +464,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
print(
"Log - RNIModalView.presentModal - Start presenting"
+ " - self.reactTag: \(self.reactTag ?? -1)"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
+ " - self.modalID: \(self.modalID ?? "N/A")"
+ " - self.presentationStyle: \(self.synthesizedModalPresentationStyle)"
Expand Down Expand Up @@ -498,7 +498,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Log - RNIModalView.presentModal - Present modal finished"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
+ " - self.modalID: \(self.modalID ?? "N/A")"
);
Expand All @@ -511,7 +511,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.dismissModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
+ " - Guard check failed: Modal presented state unknown"
);
Expand All @@ -524,7 +524,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.dismissModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Guard check failed: Unable to get modalVC"
);
#endif
Expand All @@ -542,7 +542,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Error - RNIModalView.dismissModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Guard check failed: Unable to dismiss"
+ " - shouldDismiss: \(shouldDismiss)"
+ " - isModalInFocus: \(isModalInFocus)"
Expand All @@ -561,7 +561,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Log - RNIModalView.dismissModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Start dismissing modal"
);
#endif
Expand All @@ -584,7 +584,7 @@ class RNIModalView: UIView, RNIIdentifiable, RNIModalFocusNotifying,
#if DEBUG
print(
"Log - RNIModalView.dismissModal"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - Dismiss modal finished"
);
#endif
Expand Down Expand Up @@ -645,7 +645,7 @@ extension RNIModalView: UIAdaptivePresentationControllerDelegate {
#if DEBUG
print(
"Log - RNIModalView.presentationControllerWillDismiss"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
);
#endif
Expand All @@ -667,7 +667,7 @@ extension RNIModalView: UIAdaptivePresentationControllerDelegate {
#if DEBUG
print(
"Log - RNIModalView.presentationControllerDidDismiss"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
);
#endif
};
Expand All @@ -680,7 +680,7 @@ extension RNIModalView: UIAdaptivePresentationControllerDelegate {
#if DEBUG
print(
"Log - RNIModalView.presentationControllerDidAttemptToDismiss"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
);
#endif
Expand Down Expand Up @@ -732,10 +732,10 @@ extension RNIModalView: RNIModalFocusNotifiable {
#if DEBUG
print(
"Log - RNIModalView.onModalDidFocusNotification"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
+ " - arg modal.synthesizedStringID: \(sender.synthesizedStringID)"
+ " - arg modal.modalIndex: \(sender.modalIndex!)"
+ " - arg sender.modalNativeID: \(sender.modalNativeID)"
+ " - arg sender.modalIndex: \(sender.modalIndex!)"
);
#endif

Expand All @@ -758,10 +758,10 @@ extension RNIModalView: RNIModalFocusNotifiable {
#if DEBUG
print(
"Log - RNIModalView.onModalDidBlurNotification"
+ " - self.synthesizedStringID: \(self.synthesizedStringID)"
+ " - self.modalNativeID: \(self.modalNativeID)"
+ " - self.modalIndex: \(self.modalIndex!)"
+ " - arg modal.synthesizedStringID: \(sender.synthesizedStringID)"
+ " - arg modal.modalIndex: \(sender.modalIndex!)"
+ " - arg sender.modalNativeID: \(sender.modalNativeID)"
+ " - arg sender.modalIndex: \(sender.modalIndex!)"
);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class RNIModalViewController: UIViewController {
#if DEBUG
print(
"Log - RNIModalViewController.blurEffectStyle - didSet"
+ " - modalNativeID: '\(self.modalViewRef?.synthesizedStringID ?? "N/A")'"
+ " - modalNativeID: '\(self.modalViewRef?.modalNativeID ?? "N/A")'"
+ " - oldValue: '\(oldValue!.description)'"
+ " - newValue: '\(blurEffectStyle.description)'"
);
Expand Down Expand Up @@ -109,7 +109,7 @@ class RNIModalViewController: UIViewController {
#if DEBUG
print(
"Log - RNIModalViewController.viewDidLayoutSubviews"
+ " - modalNativeID: '\(self.modalViewRef?.synthesizedStringID ?? "N/A")'"
+ " - modalNativeID: '\(self.modalViewRef?.modalNativeID ?? "N/A")'"
+ " - self.prevBounds: \(String(describing: self.prevBounds))"
+ " - nextBounds: \(nextBounds)"
);
Expand All @@ -135,7 +135,7 @@ class RNIModalViewController: UIViewController {
#if DEBUG
print(
"Log - RNIModalViewController.updateBackgroundTransparency"
+ " - modalNativeID: '\(self.modalViewRef?.synthesizedStringID ?? "N/A")'"
+ " - modalNativeID: '\(self.modalViewRef?.modalNativeID ?? "N/A")'"
+ " - self.isBGTransparent: \(self.isBGTransparent)"
);
#endif
Expand All @@ -157,7 +157,7 @@ class RNIModalViewController: UIViewController {
#if DEBUG
print(
"Log - RNIModalViewController.initBackgroundBlur"
+ " - modalNativeID: '\(self.modalViewRef?.synthesizedStringID ?? "N/A")'"
+ " - modalNativeID: '\(self.modalViewRef?.modalNativeID ?? "N/A")'"
+ " - self.blurEffectStyle: \(blurEffect)"
);
#endif
Expand Down Expand Up @@ -198,7 +198,7 @@ class RNIModalViewController: UIViewController {
#if DEBUG
print(
"Log - RNIModalViewController.updateBackgroundBlur"
+ " - modalNativeID: '\(self.modalViewRef?.synthesizedStringID ?? "N/A")'"
+ " - modalNativeID: '\(self.modalViewRef?.modalNativeID ?? "N/A")'"
+ " - blurEffectStyle: \(blurEffectStyle)"
);
#endif
Expand Down

0 comments on commit aea42d7

Please sign in to comment.