RCTRootViewDelegate.h 965 B

123456789101112131415161718192021222324252627282930
  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 <Foundation/Foundation.h>
  8. @class RCTRootView;
  9. @protocol RCTRootViewDelegate <NSObject>
  10. /**
  11. * Called after the root view's intrinsic content size is changed.
  12. *
  13. * The method is not called when both old size and new size have
  14. * a dimension that equals to zero.
  15. *
  16. * The delegate can use this callback to appropriately resize
  17. * the root view's frame to fit the new intrinsic content view size,
  18. * but usually it is not necessary because the root view will also call
  19. * `setNeedsLayout` for its superview which in its turn will trigger relayout.
  20. *
  21. * The new intrinsic content size is available via the `intrinsicContentSize`
  22. * property of the root view. The view will not resize itself.
  23. */
  24. - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView;
  25. @end