From dc61078c9aac04205ed31504e36ee6c45c672618 Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Mon, 7 Oct 2024 08:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20Refactor:=20Move=20+=20Group=20R?= =?UTF-8?q?elated=20Sources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIViewController+RNIModalHelpers.swift | 20 +++++++++++++++++++ .../RNIModalViewControllerMetrics.swift | 0 .../RNIPresentationControllerMetrics.swift | 0 .../ModalFocusState.swift | 0 .../{ => ModalLifecycle}/ModalState.swift | 0 .../ModalViewControllerEventsNotifiable.swift | 0 ...ModalViewControllerLifecycleNotifier.swift | 0 ...SheetBottomAttachedOverlayController.swift | 0 ...eetBottomAttachedOverlayLayoutConfig.swift | 0 ...tomAttachedOverlayLayoutConfigPreset.swift | 0 .../ModalSheetBottomDistance.swift | 0 ...eetPresentationStateEventsNotifiable.swift | 0 .../ModalSheetPresentationStateMachine.swift | 0 .../ModalSheetState.swift | 0 ...lSheetViewControllerEventsNotifiable.swift | 0 ...SheetViewControllerLifecycleNotifier.swift | 0 .../RNIContentPositioningMode.swift | 0 .../RNIContentSizingMode.swift | 0 .../RNIContentViewController.swift | 0 ios/Temp/UIViewController+ModalHelpers.swift | 8 -------- .../ViewControllerLifecycleNotifiable.swift | 0 .../ViewControllerLifecycleNotifier.swift | 0 22 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 ios/Extenstion+Helpers/UIViewController+RNIModalHelpers.swift rename ios/{Temp => RNIModalSheetView}/RNIModalViewControllerMetrics.swift (100%) rename ios/{Temp => RNIModalSheetView}/RNIPresentationControllerMetrics.swift (100%) rename ios/Temp/{ => ModalLifecycle}/ModalFocusState.swift (100%) rename ios/Temp/{ => ModalLifecycle}/ModalState.swift (100%) rename ios/Temp/{ => ModalLifecycle}/ModalViewControllerEventsNotifiable.swift (100%) rename ios/Temp/{ => ModalLifecycle}/ModalViewControllerLifecycleNotifier.swift (100%) rename ios/{ModalSheet => Temp/ModalSheetBottomAttachedOverlay}/ModalSheetBottomAttachedOverlayController.swift (100%) rename ios/{ModalSheet => Temp/ModalSheetBottomAttachedOverlay}/ModalSheetBottomAttachedOverlayLayoutConfig.swift (100%) rename ios/{ModalSheet => Temp/ModalSheetBottomAttachedOverlay}/ModalSheetBottomAttachedOverlayLayoutConfigPreset.swift (100%) rename ios/{ModalSheet => Temp/ModalSheetBottomAttachedOverlay}/ModalSheetBottomDistance.swift (100%) rename ios/Temp/{ => ModalSheetLifecycle}/ModalSheetPresentationStateEventsNotifiable.swift (100%) rename ios/Temp/{ => ModalSheetLifecycle}/ModalSheetPresentationStateMachine.swift (100%) rename ios/Temp/{ => ModalSheetLifecycle}/ModalSheetState.swift (100%) rename ios/Temp/{ => ModalSheetLifecycle}/ModalSheetViewControllerEventsNotifiable.swift (100%) rename ios/Temp/{ => ModalSheetLifecycle}/ModalSheetViewControllerLifecycleNotifier.swift (100%) rename ios/Temp/{ => RNIContentViewController}/RNIContentPositioningMode.swift (100%) rename ios/Temp/{ => RNIContentViewController}/RNIContentSizingMode.swift (100%) rename ios/Temp/{ => RNIContentViewController}/RNIContentViewController.swift (100%) rename ios/Temp/{ => ViewControllerLifecycle}/ViewControllerLifecycleNotifiable.swift (100%) rename ios/Temp/{ => ViewControllerLifecycle}/ViewControllerLifecycleNotifier.swift (100%) diff --git a/ios/Extenstion+Helpers/UIViewController+RNIModalHelpers.swift b/ios/Extenstion+Helpers/UIViewController+RNIModalHelpers.swift new file mode 100644 index 00000000..2f4c94b2 --- /dev/null +++ b/ios/Extenstion+Helpers/UIViewController+RNIModalHelpers.swift @@ -0,0 +1,20 @@ +// +// UIViewController+RNIModalHelpers.swift +// react-native-ios-modal +// +// Created by Dominic Go on 10/7/24. +// + +import UIKit + + +public extension UIViewController { + + var modalMetrics: RNIModalViewControllerMetrics { + .init(viewController: self); + }; + + var presentationControllerMetrics: RNIPresentationControllerMetrics? { + self.presentationController?.presentationControllerMetrics; + }; +}; diff --git a/ios/Temp/RNIModalViewControllerMetrics.swift b/ios/RNIModalSheetView/RNIModalViewControllerMetrics.swift similarity index 100% rename from ios/Temp/RNIModalViewControllerMetrics.swift rename to ios/RNIModalSheetView/RNIModalViewControllerMetrics.swift diff --git a/ios/Temp/RNIPresentationControllerMetrics.swift b/ios/RNIModalSheetView/RNIPresentationControllerMetrics.swift similarity index 100% rename from ios/Temp/RNIPresentationControllerMetrics.swift rename to ios/RNIModalSheetView/RNIPresentationControllerMetrics.swift diff --git a/ios/Temp/ModalFocusState.swift b/ios/Temp/ModalLifecycle/ModalFocusState.swift similarity index 100% rename from ios/Temp/ModalFocusState.swift rename to ios/Temp/ModalLifecycle/ModalFocusState.swift diff --git a/ios/Temp/ModalState.swift b/ios/Temp/ModalLifecycle/ModalState.swift similarity index 100% rename from ios/Temp/ModalState.swift rename to ios/Temp/ModalLifecycle/ModalState.swift diff --git a/ios/Temp/ModalViewControllerEventsNotifiable.swift b/ios/Temp/ModalLifecycle/ModalViewControllerEventsNotifiable.swift similarity index 100% rename from ios/Temp/ModalViewControllerEventsNotifiable.swift rename to ios/Temp/ModalLifecycle/ModalViewControllerEventsNotifiable.swift diff --git a/ios/Temp/ModalViewControllerLifecycleNotifier.swift b/ios/Temp/ModalLifecycle/ModalViewControllerLifecycleNotifier.swift similarity index 100% rename from ios/Temp/ModalViewControllerLifecycleNotifier.swift rename to ios/Temp/ModalLifecycle/ModalViewControllerLifecycleNotifier.swift diff --git a/ios/ModalSheet/ModalSheetBottomAttachedOverlayController.swift b/ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomAttachedOverlayController.swift similarity index 100% rename from ios/ModalSheet/ModalSheetBottomAttachedOverlayController.swift rename to ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomAttachedOverlayController.swift diff --git a/ios/ModalSheet/ModalSheetBottomAttachedOverlayLayoutConfig.swift b/ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomAttachedOverlayLayoutConfig.swift similarity index 100% rename from ios/ModalSheet/ModalSheetBottomAttachedOverlayLayoutConfig.swift rename to ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomAttachedOverlayLayoutConfig.swift diff --git a/ios/ModalSheet/ModalSheetBottomAttachedOverlayLayoutConfigPreset.swift b/ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomAttachedOverlayLayoutConfigPreset.swift similarity index 100% rename from ios/ModalSheet/ModalSheetBottomAttachedOverlayLayoutConfigPreset.swift rename to ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomAttachedOverlayLayoutConfigPreset.swift diff --git a/ios/ModalSheet/ModalSheetBottomDistance.swift b/ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomDistance.swift similarity index 100% rename from ios/ModalSheet/ModalSheetBottomDistance.swift rename to ios/Temp/ModalSheetBottomAttachedOverlay/ModalSheetBottomDistance.swift diff --git a/ios/Temp/ModalSheetPresentationStateEventsNotifiable.swift b/ios/Temp/ModalSheetLifecycle/ModalSheetPresentationStateEventsNotifiable.swift similarity index 100% rename from ios/Temp/ModalSheetPresentationStateEventsNotifiable.swift rename to ios/Temp/ModalSheetLifecycle/ModalSheetPresentationStateEventsNotifiable.swift diff --git a/ios/Temp/ModalSheetPresentationStateMachine.swift b/ios/Temp/ModalSheetLifecycle/ModalSheetPresentationStateMachine.swift similarity index 100% rename from ios/Temp/ModalSheetPresentationStateMachine.swift rename to ios/Temp/ModalSheetLifecycle/ModalSheetPresentationStateMachine.swift diff --git a/ios/Temp/ModalSheetState.swift b/ios/Temp/ModalSheetLifecycle/ModalSheetState.swift similarity index 100% rename from ios/Temp/ModalSheetState.swift rename to ios/Temp/ModalSheetLifecycle/ModalSheetState.swift diff --git a/ios/Temp/ModalSheetViewControllerEventsNotifiable.swift b/ios/Temp/ModalSheetLifecycle/ModalSheetViewControllerEventsNotifiable.swift similarity index 100% rename from ios/Temp/ModalSheetViewControllerEventsNotifiable.swift rename to ios/Temp/ModalSheetLifecycle/ModalSheetViewControllerEventsNotifiable.swift diff --git a/ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift b/ios/Temp/ModalSheetLifecycle/ModalSheetViewControllerLifecycleNotifier.swift similarity index 100% rename from ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift rename to ios/Temp/ModalSheetLifecycle/ModalSheetViewControllerLifecycleNotifier.swift diff --git a/ios/Temp/RNIContentPositioningMode.swift b/ios/Temp/RNIContentViewController/RNIContentPositioningMode.swift similarity index 100% rename from ios/Temp/RNIContentPositioningMode.swift rename to ios/Temp/RNIContentViewController/RNIContentPositioningMode.swift diff --git a/ios/Temp/RNIContentSizingMode.swift b/ios/Temp/RNIContentViewController/RNIContentSizingMode.swift similarity index 100% rename from ios/Temp/RNIContentSizingMode.swift rename to ios/Temp/RNIContentViewController/RNIContentSizingMode.swift diff --git a/ios/Temp/RNIContentViewController.swift b/ios/Temp/RNIContentViewController/RNIContentViewController.swift similarity index 100% rename from ios/Temp/RNIContentViewController.swift rename to ios/Temp/RNIContentViewController/RNIContentViewController.swift diff --git a/ios/Temp/UIViewController+ModalHelpers.swift b/ios/Temp/UIViewController+ModalHelpers.swift index 1910d27b..bdc75fd2 100644 --- a/ios/Temp/UIViewController+ModalHelpers.swift +++ b/ios/Temp/UIViewController+ModalHelpers.swift @@ -141,12 +141,4 @@ extension UIViewController { return window.currentModalLevel; }; - - public var modalMetrics: RNIModalViewControllerMetrics { - .init(viewController: self); - }; - - public var presentationControllerMetrics: RNIPresentationControllerMetrics? { - self.presentationController?.presentationControllerMetrics; - }; }; diff --git a/ios/Temp/ViewControllerLifecycleNotifiable.swift b/ios/Temp/ViewControllerLifecycle/ViewControllerLifecycleNotifiable.swift similarity index 100% rename from ios/Temp/ViewControllerLifecycleNotifiable.swift rename to ios/Temp/ViewControllerLifecycle/ViewControllerLifecycleNotifiable.swift diff --git a/ios/Temp/ViewControllerLifecycleNotifier.swift b/ios/Temp/ViewControllerLifecycle/ViewControllerLifecycleNotifier.swift similarity index 100% rename from ios/Temp/ViewControllerLifecycleNotifier.swift rename to ios/Temp/ViewControllerLifecycle/ViewControllerLifecycleNotifier.swift