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:
Родитель
5d3d3987d8
Коммит
de47b47b7c
|
@ -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]) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче