diff --git a/ios/src_library/React Native/RNIModal/RNIModal.swift b/ios/src_library/React Native/RNIModal/RNIModal.swift index 43c26186..d9df7695 100644 --- a/ios/src_library/React Native/RNIModal/RNIModal.swift +++ b/ios/src_library/React Native/RNIModal/RNIModal.swift @@ -68,13 +68,13 @@ public protocol RNIModalRequestable: AnyObject { /// modal "focus/blur"-related notifications. /// public protocol RNIModalFocusNotifiable: AnyObject { - func onModalWillFocusNotification(sender modal: any RNIModal); + func onModalWillFocusNotification(sender: any RNIModal); - func onModalDidFocusNotification(sender modal: any RNIModal); + func onModalDidFocusNotification(sender: any RNIModal); - func onModalWillBlurNotification(sender modal: any RNIModal); + func onModalWillBlurNotification(sender: any RNIModal); - func onModalDidBlurNotification(sender modal: any RNIModal); + func onModalDidBlurNotification(sender: any RNIModal); }; diff --git a/ios/src_library/React Native/RNIModal/RNIModalManager.swift b/ios/src_library/React Native/RNIModal/RNIModalManager.swift index cc21229c..ffc811a6 100644 --- a/ios/src_library/React Native/RNIModal/RNIModalManager.swift +++ b/ios/src_library/React Native/RNIModal/RNIModalManager.swift @@ -204,78 +204,76 @@ public class RNIModalManager { /// extension RNIModalManager: RNIModalFocusNotifiable { - public func onModalWillFocusNotification( - sender modal: any RNIModal - ) { + public func onModalWillFocusNotification(sender: any RNIModal) { let nextModalIndex = self.currentModalIndex + 1; self.currentModalIndex = nextModalIndex; - modal.modalIndexPrev = modal.modalIndex; - modal.modalIndex = nextModalIndex; + sender.modalIndexPrev = sender.modalIndex; + sender.modalIndex = nextModalIndex; - modal.onModalWillFocusNotification(sender: modal); + sender.onModalWillFocusNotification(sender: sender); self.modalInstances.forEach { - guard $0 !== modal, + guard $0 !== sender, $0.isModalPresented, $0.isModalInFocus, $0.modalIndex == self.currentModalIndex - 1 else { return }; - $0.onModalWillBlurNotification(sender: modal); + $0.onModalWillBlurNotification(sender: sender); }; }; - public func onModalDidFocusNotification(sender modal: any RNIModal) { - modal.isModalInFocus = true; - modal.isModalPresented = true; + public func onModalDidFocusNotification(sender: any RNIModal) { + sender.isModalInFocus = true; + sender.isModalPresented = true; - modal.onModalDidFocusNotification(sender: modal); + sender.onModalDidFocusNotification(sender: sender); self.modalInstances.forEach { - guard $0 !== modal, + guard $0 !== sender, $0.isModalPresented, $0.isModalInFocus, $0.modalIndex == self.currentModalIndex - 1 else { return }; $0.isModalInFocus = false; - $0.onModalDidBlurNotification(sender: modal); + $0.onModalDidBlurNotification(sender: sender); }; }; - public func onModalWillBlurNotification(sender modal: any RNIModal) { + public func onModalWillBlurNotification(sender: any RNIModal) { self.currentModalIndex -= 1; - modal.modalIndexPrev = modal.modalIndex; - modal.modalIndex = -1; + sender.modalIndexPrev = sender.modalIndex; + sender.modalIndex = -1; - modal.onModalWillBlurNotification(sender: modal); + sender.onModalWillBlurNotification(sender: sender); self.modalInstances.forEach { - guard $0 !== modal, + guard $0 !== sender, $0.isModalPresented, !$0.isModalInFocus, $0.modalIndex >= self.currentModalIndex else { return }; - $0.onModalWillFocusNotification(sender: modal); + $0.onModalWillFocusNotification(sender: sender); }; }; - public func onModalDidBlurNotification(sender modal: any RNIModal) { - modal.isModalInFocus = false; - modal.isModalPresented = false; + public func onModalDidBlurNotification(sender: any RNIModal) { + sender.isModalInFocus = false; + sender.isModalPresented = false; self.modalInstances.forEach { - guard $0 !== modal, + guard $0 !== sender, $0.isModalPresented, !$0.isModalInFocus, $0.modalIndex >= self.currentModalIndex else { return }; $0.isModalInFocus = true; - $0.onModalDidFocusNotification(sender: modal); + $0.onModalDidFocusNotification(sender: sender); }; }; }; diff --git a/ios/src_library/React Native/RNIModalView/RNIModalView.swift b/ios/src_library/React Native/RNIModalView/RNIModalView.swift index d5311163..69da6a10 100644 --- a/ios/src_library/React Native/RNIModalView/RNIModalView.swift +++ b/ios/src_library/React Native/RNIModalView/RNIModalView.swift @@ -717,16 +717,16 @@ extension RNIModalView: RNIModalRequestable { extension RNIModalView: RNIModalFocusNotifiable { - func onModalWillFocusNotification(sender modal: any RNIModal) { + func onModalWillFocusNotification(sender: any RNIModal) { /// No-op - TBA }; - func onModalDidFocusNotification(sender modal: any RNIModal) { + func onModalDidFocusNotification(sender: any RNIModal) { let eventData = RNIOnModalFocusEventData( modalData: self.synthesizedBaseEventData, - senderInfo: modal.synthesizedModalData, - isInitial: modal === self + senderInfo: sender.synthesizedModalData, + isInitial: sender === self ); #if DEBUG @@ -734,8 +734,8 @@ extension RNIModalView: RNIModalFocusNotifiable { "Log - RNIModalView.onModalDidFocusNotification" + " - self.synthesizedStringID: \(self.synthesizedStringID)" + " - self.modalIndex: \(self.modalIndex!)" - + " - arg modal.synthesizedStringID: \(modal.synthesizedStringID)" - + " - arg modal.modalIndex: \(modal.modalIndex!)" + + " - arg modal.synthesizedStringID: \(sender.synthesizedStringID)" + + " - arg modal.modalIndex: \(sender.modalIndex!)" ); #endif @@ -744,15 +744,15 @@ extension RNIModalView: RNIModalFocusNotifiable { ); }; - func onModalWillBlurNotification(sender modal: any RNIModal) { + func onModalWillBlurNotification(sender: any RNIModal) { /// No-op - TBA }; - func onModalDidBlurNotification(sender modal: any RNIModal) { + func onModalDidBlurNotification(sender: any RNIModal) { let eventData = RNIOnModalFocusEventData( modalData: self.synthesizedBaseEventData, - senderInfo: modal.synthesizedModalData, - isInitial: modal === self + senderInfo: sender.synthesizedModalData, + isInitial: sender === self ); #if DEBUG @@ -760,8 +760,8 @@ extension RNIModalView: RNIModalFocusNotifiable { "Log - RNIModalView.onModalDidBlurNotification" + " - self.synthesizedStringID: \(self.synthesizedStringID)" + " - self.modalIndex: \(self.modalIndex!)" - + " - arg modal.synthesizedStringID: \(modal.synthesizedStringID)" - + " - arg modal.modalIndex: \(modal.modalIndex!)" + + " - arg modal.synthesizedStringID: \(sender.synthesizedStringID)" + + " - arg modal.modalIndex: \(sender.modalIndex!)" ); #endif