Fabric: findScrollViewComponentViewForView was moved to RCTScrollViewComponentView

Summary: This way we can reuse this code in other RCTScrollViewComponentView-satellite components, especially in standard pull-to-refresh component.

Reviewed By: mdvacca

Differential Revision: D15403307

fbshipit-source-id: 5999f851f22db0f358887e1a86d610e163adcb1d
This commit is contained in:
Valentin Shergin 2019-05-19 17:40:45 -07:00 коммит произвёл Facebook Github Bot
Родитель 5d3d3987d8
Коммит de47b47b7c
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -22,6 +22,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface RCTScrollViewComponentView : RCTViewComponentView
/*
* Finds and returns the closet RCTScrollViewComponentView component to the given view
*/
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view;
/*
* Returns an actual UIScrollView that this component uses under the hood.
*/

Просмотреть файл

@ -31,6 +31,14 @@ using namespace facebook::react;
CGSize _contentSize;
}
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view
{
do {
view = view.superview;
} while (view != nil && ![view isKindOfClass:[RCTScrollViewComponentView class]]);
return (RCTScrollViewComponentView *)view;
}
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {