From 9ea1f9f534f6e309cd647d4c6999601861716685 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Mon, 21 Nov 2022 20:09:09 -0800 Subject: [PATCH 1/5] [Fabric] Replace UIKit with RCTUIKit --- .../ActivityIndicator/RCTActivityIndicatorViewComponentView.h | 2 +- .../InputAccessory/RCTInputAccessoryComponentView.h | 2 +- .../InputAccessory/RCTInputAccessoryContentView.h | 2 +- .../RCTLegacyViewManagerInteropComponentView.h | 2 +- .../ComponentViews/Modal/RCTFabricModalHostViewController.h | 2 +- .../Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h | 2 +- .../ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h | 2 +- .../Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h | 2 +- .../ScrollView/RCTPullToRefreshViewComponentView.h | 2 +- .../ComponentViews/ScrollView/RCTScrollViewComponentView.h | 2 +- .../Mounting/ComponentViews/Slider/RCTSliderComponentView.h | 2 +- .../Mounting/ComponentViews/Switch/RCTSwitchComponentView.h | 2 +- .../Mounting/ComponentViews/Text/RCTAccessibilityElement.h | 2 +- .../Text/RCTParagraphComponentAccessibilityProvider.h | 2 +- .../Mounting/ComponentViews/Text/RCTParagraphComponentView.h | 2 +- .../ComponentViews/TextInput/RCTTextInputComponentView.h | 2 +- .../Mounting/ComponentViews/TextInput/RCTTextInputUtils.h | 2 +- .../RCTUnimplementedNativeComponentView.h | 3 ++- .../UnimplementedView/RCTUnimplementedViewComponentView.h | 2 +- .../Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h | 2 +- React/Fabric/Mounting/RCTComponentViewClassDescriptor.h | 2 +- React/Fabric/Mounting/RCTComponentViewDescriptor.h | 2 +- React/Fabric/Mounting/RCTComponentViewFactory.h | 2 +- React/Fabric/Mounting/RCTComponentViewProtocol.h | 2 +- React/Fabric/Mounting/RCTComponentViewRegistry.h | 2 +- React/Fabric/Mounting/RCTMountingManager.h | 2 +- React/Fabric/Mounting/RCTMountingManagerDelegate.h | 2 +- React/Fabric/Mounting/RCTMountingTransactionObserving.h | 2 +- React/Fabric/Mounting/UIView+ComponentViewProtocol.h | 2 +- React/Fabric/RCTConversions.h | 2 +- React/Fabric/RCTImageResponseDelegate.h | 2 +- React/Fabric/RCTLocalizationProvider.h | 2 +- React/Fabric/RCTScheduler.h | 2 +- React/Fabric/RCTSurfacePresenter.h | 2 +- React/Fabric/RCTSurfacePresenterBridgeAdapter.h | 2 +- React/Fabric/RCTSurfaceRegistry.h | 2 +- React/Fabric/RCTSurfaceTouchHandler.h | 2 +- React/Fabric/RCTTouchableComponentViewProtocol.h | 2 +- React/Fabric/Utils/RCTGenericDelegateSplitter.h | 2 +- React/Views/RCTMaskedView.h | 2 +- React/Views/RCTModalHostView.h | 2 +- React/Views/RCTModalHostViewController.h | 2 +- React/Views/RCTModalManager.h | 2 +- React/Views/RCTWrapperViewController.h | 2 +- React/Views/RefreshControl/RCTRefreshControl.h | 2 +- React/Views/RefreshControl/RCTRefreshableProtocol.h | 2 +- React/Views/SafeAreaView/RCTSafeAreaView.h | 2 +- React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h | 2 +- .../RCTLegacyViewManagerInteropCoordinator.h | 2 +- .../renderer/graphics/platform/ios/RCTPlatformColorUtils.mm | 2 +- .../react/renderer/imagemanager/platform/ios/RCTImageManager.h | 2 +- .../imagemanager/platform/ios/RCTImagePrimitivesConversions.h | 2 +- .../renderer/imagemanager/platform/ios/RCTSyncImageManager.h | 2 +- .../textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h | 2 +- .../textlayoutmanager/platform/ios/RCTAttributedTextUtils.h | 2 +- .../textlayoutmanager/platform/ios/RCTFontProperties.h | 2 +- .../renderer/textlayoutmanager/platform/ios/RCTFontUtils.h | 2 +- .../textlayoutmanager/platform/ios/RCTTextLayoutManager.h | 2 +- .../platform/ios/RCTTextPrimitivesConversions.h | 2 +- 59 files changed, 60 insertions(+), 59 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h index 0551b81eb70960..1a2b1b14459027 100644 --- a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h b/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h index c2c80a662203fb..45c477397bd9e2 100644 --- a/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h b/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h index 0054ce06aeae7b..554614a47f8e9e 100644 --- a/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +++ b/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) @interface RCTInputAccessoryContentView : UIView diff --git a/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h b/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h index fae91e1b10d4b9..ef23fa36221caa 100644 --- a/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h index 149a9788e2c1b2..4bd66b48a468b4 100644 --- a/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +++ b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) @protocol RCTFabricModalHostViewControllerDelegate - (void)boundsDidChange:(CGRect)newBounds; diff --git a/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h index cce48d6ffcb922..e028aed693b1ad 100644 --- a/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h index 542b88cf14fae7..84e11aacbfcb08 100644 --- a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h index 6402bc6c86c155..3c85ab290f8494 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h index 3048aa48f9baf5..264d306b49b51c 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 8edb46868b19e8..785d28a47c79dd 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h index 5ddbef2017ad2a..a436db3af4bf1f 100644 --- a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h index 09fb855be5bd4b..77b88e8c316a85 100644 --- a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h b/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h index 7d06fb61ba8297..2c627de977cf68 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h index 3fb0da7c2a5f08..5187981b4f806d 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h index 0744e4a530c86b..050fb5a1ebceba 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h index 927fbc4e3d33d3..d36a4f11ffbaf8 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h index ffaac133609248..1d170c50bc50f6 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h b/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h index fcd2ebe7b7cc5a..7c35ec552bbe6d 100644 --- a/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h @@ -5,7 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) +#import "React/RCTUITextView.h" #import diff --git a/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h b/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h index 8c2c82a3f0c5c8..5354d3611035ab 100644 --- a/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h index 48298f3fc90add..273ee5c4905c9d 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h b/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h index b03a4642a98123..f4826fc4ae9f60 100644 --- a/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +++ b/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/RCTComponentViewDescriptor.h b/React/Fabric/Mounting/RCTComponentViewDescriptor.h index f933f2520b0747..753fb399f70ae0 100644 --- a/React/Fabric/Mounting/RCTComponentViewDescriptor.h +++ b/React/Fabric/Mounting/RCTComponentViewDescriptor.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/RCTComponentViewFactory.h b/React/Fabric/Mounting/RCTComponentViewFactory.h index 771131d50f4407..960daa9dc7f137 100644 --- a/React/Fabric/Mounting/RCTComponentViewFactory.h +++ b/React/Fabric/Mounting/RCTComponentViewFactory.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/RCTComponentViewProtocol.h b/React/Fabric/Mounting/RCTComponentViewProtocol.h index 50d7d434f560ff..6f0f98fa14062b 100644 --- a/React/Fabric/Mounting/RCTComponentViewProtocol.h +++ b/React/Fabric/Mounting/RCTComponentViewProtocol.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/RCTComponentViewRegistry.h b/React/Fabric/Mounting/RCTComponentViewRegistry.h index bcf78a20ccd236..31acca6a2069f6 100644 --- a/React/Fabric/Mounting/RCTComponentViewRegistry.h +++ b/React/Fabric/Mounting/RCTComponentViewRegistry.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/RCTMountingManager.h b/React/Fabric/Mounting/RCTMountingManager.h index d30d297e366749..235ac0539a8e6e 100644 --- a/React/Fabric/Mounting/RCTMountingManager.h +++ b/React/Fabric/Mounting/RCTMountingManager.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/Mounting/RCTMountingManagerDelegate.h b/React/Fabric/Mounting/RCTMountingManagerDelegate.h index 21653fe033616f..7c4b3e0a126ef7 100644 --- a/React/Fabric/Mounting/RCTMountingManagerDelegate.h +++ b/React/Fabric/Mounting/RCTMountingManagerDelegate.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/Mounting/RCTMountingTransactionObserving.h b/React/Fabric/Mounting/RCTMountingTransactionObserving.h index c24029a2d81ab1..a09905ea7b30ec 100644 --- a/React/Fabric/Mounting/RCTMountingTransactionObserving.h +++ b/React/Fabric/Mounting/RCTMountingTransactionObserving.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #include diff --git a/React/Fabric/Mounting/UIView+ComponentViewProtocol.h b/React/Fabric/Mounting/UIView+ComponentViewProtocol.h index 7b0dd3e96b3bf7..a17eb8a6db6f7e 100644 --- a/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +++ b/React/Fabric/Mounting/UIView+ComponentViewProtocol.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/RCTConversions.h b/React/Fabric/RCTConversions.h index 58cbfeb466b64e..0f8e8e26df5f38 100644 --- a/React/Fabric/RCTConversions.h +++ b/React/Fabric/RCTConversions.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/RCTImageResponseDelegate.h b/React/Fabric/RCTImageResponseDelegate.h index be55fa93f53381..3744c1d2bc69ae 100644 --- a/React/Fabric/RCTImageResponseDelegate.h +++ b/React/Fabric/RCTImageResponseDelegate.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/RCTLocalizationProvider.h b/React/Fabric/RCTLocalizationProvider.h index 19f87184716490..3fec8fca1a4342 100644 --- a/React/Fabric/RCTLocalizationProvider.h +++ b/React/Fabric/RCTLocalizationProvider.h @@ -6,7 +6,7 @@ */ #import -#import +#import // TODO(macOS GH#774) @protocol RCTLocalizationProtocol diff --git a/React/Fabric/RCTScheduler.h b/React/Fabric/RCTScheduler.h index bebc5fd90f0050..7edf36aad5c8ef 100644 --- a/React/Fabric/RCTScheduler.h +++ b/React/Fabric/RCTScheduler.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/RCTSurfacePresenter.h b/React/Fabric/RCTSurfacePresenter.h index 8e645be4c413c5..cb4883fd619cbe 100644 --- a/React/Fabric/RCTSurfacePresenter.h +++ b/React/Fabric/RCTSurfacePresenter.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Fabric/RCTSurfacePresenterBridgeAdapter.h b/React/Fabric/RCTSurfacePresenterBridgeAdapter.h index 188d19992c6760..43a0b3ab45c229 100644 --- a/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +++ b/React/Fabric/RCTSurfacePresenterBridgeAdapter.h @@ -7,7 +7,7 @@ #import #import -#import +#import // TODO(macOS GH#774) #import NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/RCTSurfaceRegistry.h b/React/Fabric/RCTSurfaceRegistry.h index 4b369cc64b4143..c01231c8a426b9 100644 --- a/React/Fabric/RCTSurfaceRegistry.h +++ b/React/Fabric/RCTSurfaceRegistry.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Fabric/RCTSurfaceTouchHandler.h b/React/Fabric/RCTSurfaceTouchHandler.h index 6515e5f1750c3c..8df850191b8e4a 100644 --- a/React/Fabric/RCTSurfaceTouchHandler.h +++ b/React/Fabric/RCTSurfaceTouchHandler.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/RCTTouchableComponentViewProtocol.h b/React/Fabric/RCTTouchableComponentViewProtocol.h index 162aa866cb3ef3..2fe963bad510f3 100644 --- a/React/Fabric/RCTTouchableComponentViewProtocol.h +++ b/React/Fabric/RCTTouchableComponentViewProtocol.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import @protocol RCTTouchableComponentViewProtocol diff --git a/React/Fabric/Utils/RCTGenericDelegateSplitter.h b/React/Fabric/Utils/RCTGenericDelegateSplitter.h index 77bbac20d7ddc2..e7d5a5e0688627 100644 --- a/React/Fabric/Utils/RCTGenericDelegateSplitter.h +++ b/React/Fabric/Utils/RCTGenericDelegateSplitter.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) NS_ASSUME_NONNULL_BEGIN diff --git a/React/Views/RCTMaskedView.h b/React/Views/RCTMaskedView.h index cab90b6cdca3d8..6f913c057af4fe 100644 --- a/React/Views/RCTMaskedView.h +++ b/React/Views/RCTMaskedView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Views/RCTModalHostView.h b/React/Views/RCTModalHostView.h index 0246328f99f22f..be36ac164f0e76 100644 --- a/React/Views/RCTModalHostView.h +++ b/React/Views/RCTModalHostView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Views/RCTModalHostViewController.h b/React/Views/RCTModalHostViewController.h index b12b0f7fc15129..66a1659886db30 100644 --- a/React/Views/RCTModalHostViewController.h +++ b/React/Views/RCTModalHostViewController.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) @interface RCTModalHostViewController : UIViewController diff --git a/React/Views/RCTModalManager.h b/React/Views/RCTModalManager.h index 237037fd8db6b2..6cecbd16b69095 100644 --- a/React/Views/RCTModalManager.h +++ b/React/Views/RCTModalManager.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Views/RCTWrapperViewController.h b/React/Views/RCTWrapperViewController.h index b8277587684bd7..97f4816c9550eb 100644 --- a/React/Views/RCTWrapperViewController.h +++ b/React/Views/RCTWrapperViewController.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) @class RCTWrapperViewController; diff --git a/React/Views/RefreshControl/RCTRefreshControl.h b/React/Views/RefreshControl/RCTRefreshControl.h index 35c60c2878b648..a11b801f9ea895 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.h +++ b/React/Views/RefreshControl/RCTRefreshControl.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/React/Views/RefreshControl/RCTRefreshableProtocol.h b/React/Views/RefreshControl/RCTRefreshableProtocol.h index b0b06f2e4db736..ccfb6426cbeff0 100644 --- a/React/Views/RefreshControl/RCTRefreshableProtocol.h +++ b/React/Views/RefreshControl/RCTRefreshableProtocol.h @@ -6,7 +6,7 @@ */ #import -#import +#import // TODO(macOS GH#774) /** * Protocol used to dispatch commands in `RCTRefreshControlManager.h`. diff --git a/React/Views/SafeAreaView/RCTSafeAreaView.h b/React/Views/SafeAreaView/RCTSafeAreaView.h index c0fea6b7bacfc4..34e875558ecc77 100644 --- a/React/Views/SafeAreaView/RCTSafeAreaView.h +++ b/React/Views/SafeAreaView/RCTSafeAreaView.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h b/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h index b78edb76c35ece..f3a4b2bab0acd1 100644 --- a/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +++ b/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) NS_ASSUME_NONNULL_BEGIN diff --git a/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h b/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h index 2062f42a243372..7dec6d6bc19a01 100644 --- a/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +++ b/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h @@ -6,7 +6,7 @@ */ #import -#import +#import // TODO(macOS GH#774) #include NS_ASSUME_NONNULL_BEGIN diff --git a/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm b/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm index f11b2af9e40e8e..2d143e7dbbd20b 100644 --- a/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +++ b/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm @@ -9,7 +9,7 @@ #import #import -#import +#import // TODO(macOS GH#774) #include diff --git a/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h b/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h index 88130fe075573f..2d1803454c5ef3 100644 --- a/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +++ b/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h b/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h index d72e61c63f0afb..89ba290dc051a5 100644 --- a/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +++ b/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h b/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h index c0ef180bc22d6e..c028be86b5932d 100644 --- a/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +++ b/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h index a87d67d192305c..7c9ab641081368 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) @interface NSTextStorage (FontScaling) diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h index b09fd7115ebe65..0c2deaf3ae11bf 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #include #include diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h index eca30e5046838a..af3e44f95a7a57 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) NS_ASSUME_NONNULL_BEGIN diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h index ad4d7af3dd926e..d70c7a13500e03 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h index 15e4c755abc732..e973113b02f931 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #import #import diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h index 235137bde0c13a..4d90c09e4e6696 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import // TODO(macOS GH#774) #include #include From beac5921d36081a9e369acf3d61b0d7c3dadb24a Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Mon, 28 Nov 2022 15:11:20 -0800 Subject: [PATCH 2/5] [Fabric] Convert UIScrollView with RCTUIScrollView shim --- .../ScrollView/RCTEnhancedScrollView.h | 2 +- .../ScrollView/RCTEnhancedScrollView.mm | 6 ++-- .../ScrollView/RCTScrollViewComponentView.h | 8 ++--- .../ScrollView/RCTScrollViewComponentView.mm | 31 +++++++++---------- .../TextInput/RCTTextInputComponentView.mm | 2 +- .../Views/RefreshControl/RCTRefreshControl.h | 2 +- .../Views/ScrollView/RCTScrollableProtocol.h | 2 +- 7 files changed, 26 insertions(+), 27 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h index 3c85ab290f8494..d8c348a41e4412 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN * `UIScrollView` subclass which has some improvements and tweaks * which are not directly related to React Native. */ -@interface RCTEnhancedScrollView : UIScrollView +@interface RCTEnhancedScrollView : RCTUIScrollView /* * Returns a delegate splitter that can be used to create as many `UIScrollView` delegates as needed. diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index 93af874f451c58..7a2ec3c4d69bb9 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -31,7 +31,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // We set the default behavior to "never" so that iOS - // doesn't do weird things to UIScrollView insets automatically + // doesn't do weird things to RCTUIScrollView insets automatically // and keeps it as an opt-in behavior. self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; @@ -130,7 +130,7 @@ - (void)setDelegate:(id)delegate #pragma mark - UIScrollViewDelegate -- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView +- (void)scrollViewWillEndDragging:(RCTUIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { @@ -259,7 +259,7 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView #pragma mark - -- (BOOL)isHorizontal:(UIScrollView *)scrollView +- (BOOL)isHorizontal:(RCTUIScrollView *)scrollView { return scrollView.contentSize.width > self.frame.size.width; } diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 785d28a47c79dd..6cffea25e4cb6c 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN /* * UIView class for component. * - * By design, the class does not implement any logic that contradicts to the normal behavior of UIScrollView and does + * By design, the class does not implement any logic that contradicts to the normal behavior of RCTUIScrollView and does * not contain any special/custom support for things like floating headers, pull-to-refresh components, * keyboard-avoiding functionality and so on. All that complexity must be implemented inside those components in order * to keep the complexity of this component manageable. @@ -31,9 +31,9 @@ NS_ASSUME_NONNULL_BEGIN + (nullable RCTScrollViewComponentView *)findScrollViewComponentViewForView:(UIView *)view; /* - * Returns an actual UIScrollView that this component uses under the hood. + * Returns an actual RCTUIScrollView that this component uses under the hood. */ -@property (nonatomic, strong, readonly) UIScrollView *scrollView; +@property (nonatomic, strong, readonly) RCTUIScrollView *scrollView; /* * Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong, readonly) UIView *containerView; /* - * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate. + * Returns a delegate splitter that can be used to subscribe for RCTUIScrollView delegate. */ @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *scrollViewDelegateSplitter; diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 2ebbb0e82ac91e..1ed56c26ef5c35 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -56,7 +56,7 @@ static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(ScrollV // This is just a workaround to allow animations based on onScroll event. // This is only used to animate sticky headers in ScrollViews, and only the contentOffset and tag is used. // TODO: T116850910 [Fabric][iOS] Make Fabric not use legacy RCTEventDispatcher for native-driven AnimatedEvents -static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInteger tag) +static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NSInteger tag) { static uint16_t coalescingKey = 0; RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:@"onScroll" @@ -137,7 +137,7 @@ - (instancetype)initWithFrame:(CGRect)frame - (void)dealloc { - // Removing all delegates from the splitter nils the actual delegate which prevents a crash on UIScrollView + // Removing all delegates from the splitter nils the actual delegate which prevents a crash on RCTUIScrollView // deallocation. [self.scrollViewDelegateSplitter removeAllDelegates]; } @@ -416,7 +416,7 @@ - (BOOL)touchesShouldCancelInContentView:(__unused UIView *)view return ![self _shouldDisableScrollInteraction]; } -- (void)scrollViewDidScroll:(UIScrollView *)scrollView +- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView { if (!_isUserTriggeredScrolling) { [self _updateStateWithContentOffset]; @@ -435,24 +435,24 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView [self _remountChildrenIfNeeded]; } -- (void)scrollViewDidZoom:(UIScrollView *)scrollView +- (void)scrollViewDidZoom:(RCTUIScrollView *)scrollView { [self scrollViewDidScroll:scrollView]; } -- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView +- (BOOL)scrollViewShouldScrollToTop:(RCTUIScrollView *)scrollView { _isUserTriggeredScrolling = YES; return YES; } -- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView +- (void)scrollViewDidScrollToTop:(RCTUIScrollView *)scrollView { _isUserTriggeredScrolling = NO; [self _updateStateWithContentOffset]; } -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView +- (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView { [self _forceDispatchNextScrollEvent]; @@ -464,7 +464,7 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView _isUserTriggeredScrolling = YES; } -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate +- (void)scrollViewDidEndDragging:(RCTUIScrollView *)scrollView willDecelerate:(BOOL)decelerate { [self _forceDispatchNextScrollEvent]; @@ -476,7 +476,7 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL [self _updateStateWithContentOffset]; } -- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView +- (void)scrollViewWillBeginDecelerating:(RCTUIScrollView *)scrollView { [self _forceDispatchNextScrollEvent]; @@ -488,7 +488,7 @@ - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView ->onMomentumScrollBegin([self _scrollViewMetrics]); } -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView +- (void)scrollViewDidEndDecelerating:(RCTUIScrollView *)scrollView { [self _forceDispatchNextScrollEvent]; @@ -501,12 +501,12 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView _isUserTriggeredScrolling = NO; } -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView +- (void)scrollViewDidEndScrollingAnimation:(RCTUIScrollView *)scrollView { [self _handleFinishedScrolling:scrollView]; } -- (void)_handleFinishedScrolling:(UIScrollView *)scrollView +- (void)_handleFinishedScrolling:(RCTUIScrollView *)scrollView { [self _forceDispatchNextScrollEvent]; [self scrollViewDidScroll:scrollView]; @@ -519,7 +519,7 @@ - (void)_handleFinishedScrolling:(UIScrollView *)scrollView [self _updateStateWithContentOffset]; } -- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view +- (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view { [self _forceDispatchNextScrollEvent]; @@ -529,8 +529,7 @@ - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable std::static_pointer_cast(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]); } - -- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale +- (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale { [self _forceDispatchNextScrollEvent]; @@ -542,7 +541,7 @@ - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UI [self _updateStateWithContentOffset]; } -- (UIView *)viewForZoomingInScrollView:(__unused UIScrollView *)scrollView +- (UIView *)viewForZoomingInScrollView:(__unused RCTUIScrollView *)scrollView { return _containerView; } diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index c78fe580dc429b..44e5423b96dbf5 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -409,7 +409,7 @@ - (void)textInputDidChangeSelection #pragma mark - RCTBackedTextInputDelegate (UIScrollViewDelegate) -- (void)scrollViewDidScroll:(UIScrollView *)scrollView +- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView { if (_eventEmitter) { std::static_pointer_cast(_eventEmitter)->onScroll([self _textInputMetrics]); diff --git a/React/Views/RefreshControl/RCTRefreshControl.h b/React/Views/RefreshControl/RCTRefreshControl.h index a11b801f9ea895..152ef4e4d74dc1 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.h +++ b/React/Views/RefreshControl/RCTRefreshControl.h @@ -14,6 +14,6 @@ @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) RCTDirectEventBlock onRefresh; -@property (nonatomic, weak) UIScrollView *scrollView; +@property (nonatomic, weak) RCTUIScrollView *scrollView; @end diff --git a/React/Views/ScrollView/RCTScrollableProtocol.h b/React/Views/ScrollView/RCTScrollableProtocol.h index 45610b457e303e..d1ff41cea33402 100644 --- a/React/Views/ScrollView/RCTScrollableProtocol.h +++ b/React/Views/ScrollView/RCTScrollableProtocol.h @@ -42,7 +42,7 @@ #if !TARGET_OS_OSX // TODO(macOS GH#774) @optional -@property (nonatomic, weak) UIScrollView *scrollView; +@property (nonatomic, weak) RCTUIScrollView *scrollView; #endif // TODO(macOS GH#774) @end From 7756b2e4ac39b9eaa41f0c623ac6d2dad9c497e0 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Mon, 28 Nov 2022 15:36:03 -0800 Subject: [PATCH 3/5] Undo comment change --- .../ComponentViews/ScrollView/RCTScrollViewComponentView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 1ed56c26ef5c35..4e0c0891064ab6 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -137,7 +137,7 @@ - (instancetype)initWithFrame:(CGRect)frame - (void)dealloc { - // Removing all delegates from the splitter nils the actual delegate which prevents a crash on RCTUIScrollView + // Removing all delegates from the splitter nils the actual delegate which prevents a crash on UIScrollView // deallocation. [self.scrollViewDelegateSplitter removeAllDelegates]; } From 410588abbfe3fc229c57d89beae49b0815eefeb6 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Wed, 30 Nov 2022 12:01:22 -0800 Subject: [PATCH 4/5] Add macOS tags --- .../ScrollView/RCTEnhancedScrollView.h | 2 +- .../ScrollView/RCTEnhancedScrollView.mm | 6 ++-- .../ScrollView/RCTScrollViewComponentView.h | 8 +++--- .../ScrollView/RCTScrollViewComponentView.mm | 28 +++++++++---------- .../TextInput/RCTTextInputComponentView.mm | 2 +- .../Views/RefreshControl/RCTRefreshControl.h | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h index d8c348a41e4412..b09d1bc1faeb51 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN * `UIScrollView` subclass which has some improvements and tweaks * which are not directly related to React Native. */ -@interface RCTEnhancedScrollView : RCTUIScrollView +@interface RCTEnhancedScrollView : RCTUIScrollView // TODO(macOS GH#774) /* * Returns a delegate splitter that can be used to create as many `UIScrollView` delegates as needed. diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index 7a2ec3c4d69bb9..5427e2bfbb7d02 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -31,7 +31,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // We set the default behavior to "never" so that iOS - // doesn't do weird things to RCTUIScrollView insets automatically + // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior. self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; @@ -132,7 +132,7 @@ - (void)setDelegate:(id)delegate - (void)scrollViewWillEndDragging:(RCTUIScrollView *)scrollView withVelocity:(CGPoint)velocity - targetContentOffset:(inout CGPoint *)targetContentOffset + targetContentOffset:(inout CGPoint *)targetContentOffset // TODO(macOS GH#774) { if (self.snapToOffsets && self.snapToOffsets.count > 0) { // An alternative to enablePaging and snapToInterval which allows setting custom @@ -259,7 +259,7 @@ - (void)scrollViewWillEndDragging:(RCTUIScrollView *)scrollView #pragma mark - -- (BOOL)isHorizontal:(RCTUIScrollView *)scrollView +- (BOOL)isHorizontal:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { return scrollView.contentSize.width > self.frame.size.width; } diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 6cffea25e4cb6c..5dbb7aed5bf3df 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN /* * UIView class for component. * - * By design, the class does not implement any logic that contradicts to the normal behavior of RCTUIScrollView and does + * By design, the class does not implement any logic that contradicts to the normal behavior of UIScrollView and does * not contain any special/custom support for things like floating headers, pull-to-refresh components, * keyboard-avoiding functionality and so on. All that complexity must be implemented inside those components in order * to keep the complexity of this component manageable. @@ -31,9 +31,9 @@ NS_ASSUME_NONNULL_BEGIN + (nullable RCTScrollViewComponentView *)findScrollViewComponentViewForView:(UIView *)view; /* - * Returns an actual RCTUIScrollView that this component uses under the hood. + * Returns an actual UIScrollView that this component uses under the hood. */ -@property (nonatomic, strong, readonly) RCTUIScrollView *scrollView; +@property (nonatomic, strong, readonly) RCTUIScrollView *scrollView; // TODO(macOS GH#774) /* * Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong, readonly) UIView *containerView; /* - * Returns a delegate splitter that can be used to subscribe for RCTUIScrollView delegate. + * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate. */ @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *scrollViewDelegateSplitter; diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 4e0c0891064ab6..dd664cb2b3d750 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -56,7 +56,7 @@ static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(ScrollV // This is just a workaround to allow animations based on onScroll event. // This is only used to animate sticky headers in ScrollViews, and only the contentOffset and tag is used. // TODO: T116850910 [Fabric][iOS] Make Fabric not use legacy RCTEventDispatcher for native-driven AnimatedEvents -static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NSInteger tag) +static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NSInteger tag) // TODO(macOS GH#774) { static uint16_t coalescingKey = 0; RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:@"onScroll" @@ -416,7 +416,7 @@ - (BOOL)touchesShouldCancelInContentView:(__unused UIView *)view return ![self _shouldDisableScrollInteraction]; } -- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView +- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { if (!_isUserTriggeredScrolling) { [self _updateStateWithContentOffset]; @@ -435,24 +435,24 @@ - (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView [self _remountChildrenIfNeeded]; } -- (void)scrollViewDidZoom:(RCTUIScrollView *)scrollView +- (void)scrollViewDidZoom:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { [self scrollViewDidScroll:scrollView]; } -- (BOOL)scrollViewShouldScrollToTop:(RCTUIScrollView *)scrollView +- (BOOL)scrollViewShouldScrollToTop:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { _isUserTriggeredScrolling = YES; return YES; } -- (void)scrollViewDidScrollToTop:(RCTUIScrollView *)scrollView +- (void)scrollViewDidScrollToTop:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { _isUserTriggeredScrolling = NO; [self _updateStateWithContentOffset]; } -- (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView +- (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; @@ -464,7 +464,7 @@ - (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView _isUserTriggeredScrolling = YES; } -- (void)scrollViewDidEndDragging:(RCTUIScrollView *)scrollView willDecelerate:(BOOL)decelerate +- (void)scrollViewDidEndDragging:(RCTUIScrollView *)scrollView willDecelerate:(BOOL)decelerate // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; @@ -476,7 +476,7 @@ - (void)scrollViewDidEndDragging:(RCTUIScrollView *)scrollView willDecelerate:(B [self _updateStateWithContentOffset]; } -- (void)scrollViewWillBeginDecelerating:(RCTUIScrollView *)scrollView +- (void)scrollViewWillBeginDecelerating:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; @@ -488,7 +488,7 @@ - (void)scrollViewWillBeginDecelerating:(RCTUIScrollView *)scrollView ->onMomentumScrollBegin([self _scrollViewMetrics]); } -- (void)scrollViewDidEndDecelerating:(RCTUIScrollView *)scrollView +- (void)scrollViewDidEndDecelerating:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; @@ -501,12 +501,12 @@ - (void)scrollViewDidEndDecelerating:(RCTUIScrollView *)scrollView _isUserTriggeredScrolling = NO; } -- (void)scrollViewDidEndScrollingAnimation:(RCTUIScrollView *)scrollView +- (void)scrollViewDidEndScrollingAnimation:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { [self _handleFinishedScrolling:scrollView]; } -- (void)_handleFinishedScrolling:(RCTUIScrollView *)scrollView +- (void)_handleFinishedScrolling:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; [self scrollViewDidScroll:scrollView]; @@ -519,7 +519,7 @@ - (void)_handleFinishedScrolling:(RCTUIScrollView *)scrollView [self _updateStateWithContentOffset]; } -- (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view +- (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; @@ -529,7 +529,7 @@ - (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nulla std::static_pointer_cast(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]); } -- (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale +- (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent]; @@ -541,7 +541,7 @@ - (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable [self _updateStateWithContentOffset]; } -- (UIView *)viewForZoomingInScrollView:(__unused RCTUIScrollView *)scrollView +- (UIView *)viewForZoomingInScrollView:(__unused RCTUIScrollView *)scrollView // TODO(macOS GH#774) { return _containerView; } diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 44e5423b96dbf5..658ea391a134be 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -409,7 +409,7 @@ - (void)textInputDidChangeSelection #pragma mark - RCTBackedTextInputDelegate (UIScrollViewDelegate) -- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView +- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) { if (_eventEmitter) { std::static_pointer_cast(_eventEmitter)->onScroll([self _textInputMetrics]); diff --git a/React/Views/RefreshControl/RCTRefreshControl.h b/React/Views/RefreshControl/RCTRefreshControl.h index 152ef4e4d74dc1..f3d6b2cdc6e150 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.h +++ b/React/Views/RefreshControl/RCTRefreshControl.h @@ -14,6 +14,6 @@ @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) RCTDirectEventBlock onRefresh; -@property (nonatomic, weak) RCTUIScrollView *scrollView; +@property (nonatomic, weak) RCTUIScrollView *scrollView; // TODO(macOS GH#774) @end From 83608969c50ff9df7853a899c87e7e3f7547a9d2 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Wed, 30 Nov 2022 12:04:44 -0800 Subject: [PATCH 5/5] Fix whitespace --- .../ComponentViews/ScrollView/RCTScrollViewComponentView.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index dd664cb2b3d750..da4bda87e93e55 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -529,6 +529,7 @@ - (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nulla std::static_pointer_cast(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]); } + - (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale // TODO(macOS GH#774) { [self _forceDispatchNextScrollEvent];