RCTScrollContentView.m 704 B

1234567891011121314151617181920212223242526272829303132
  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]], @"Unexpected view hierarchy of RCTScrollView component.");
  20. [scrollView updateContentOffsetIfNeeded];
  21. }
  22. @end