RCTScrollContentView.m 717 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import "RCTScrollContentView.h"
  8. #import <React/RCTAssert.h>
  9. #import <React/UIView+React.h>
  10. #import "RCTScrollView.h"
  11. @implementation RCTScrollContentView
  12. - (void)reactSetFrame:(CGRect)frame
  13. {
  14. [super reactSetFrame:frame];
  15. RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview;
  16. if (!scrollView) {
  17. return;
  18. }
  19. RCTAssert([scrollView isKindOfClass:[RCTScrollView class]],
  20. @"Unexpected view hierarchy of RCTScrollView component.");
  21. [scrollView updateContentOffsetIfNeeded];
  22. }
  23. @end