mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Deprecate calculateChildFrames from RCTScrollView
Summary: This function is unused. (Followup to D21941946) Changelog: [iOS] Deprecate calculateChildFrames from RCTScrollView Reviewed By: sammy-SC Differential Revision: D22071415 fbshipit-source-id: 0c996ab02df1431ee9cfa082bc99681a2ec7118c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3ff671c704
commit
62aa84a325
@@ -600,36 +600,6 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
|
||||
RCT_FORWARD_SCROLL_EVENT(scrollViewDidScroll : scrollView);
|
||||
}
|
||||
|
||||
- (NSArray<NSDictionary *> *)calculateChildFramesData
|
||||
{
|
||||
NSMutableArray<NSDictionary *> *updatedChildFrames = [NSMutableArray new];
|
||||
[[_contentView reactSubviews] enumerateObjectsUsingBlock:^(UIView *subview, NSUInteger idx, __unused BOOL *stop) {
|
||||
// Check if new or changed
|
||||
CGRect newFrame = subview.frame;
|
||||
BOOL frameChanged = NO;
|
||||
if (self->_cachedChildFrames.count <= idx) {
|
||||
frameChanged = YES;
|
||||
[self->_cachedChildFrames addObject:[NSValue valueWithCGRect:newFrame]];
|
||||
} else if (!CGRectEqualToRect(newFrame, [self->_cachedChildFrames[idx] CGRectValue])) {
|
||||
frameChanged = YES;
|
||||
self->_cachedChildFrames[idx] = [NSValue valueWithCGRect:newFrame];
|
||||
}
|
||||
|
||||
// Create JS frame object
|
||||
if (frameChanged) {
|
||||
[updatedChildFrames addObject:@{
|
||||
@"index" : @(idx),
|
||||
@"x" : @(newFrame.origin.x),
|
||||
@"y" : @(newFrame.origin.y),
|
||||
@"width" : @(newFrame.size.width),
|
||||
@"height" : @(newFrame.size.height),
|
||||
}];
|
||||
}
|
||||
}];
|
||||
|
||||
return updatedChildFrames;
|
||||
}
|
||||
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
_allowNextScrollNoMatterWhat = YES; // Ensure next scroll event is recorded, regardless of throttle
|
||||
|
||||
Reference in New Issue
Block a user