mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 09:35:48 +00:00
e1577df1fd
Summary: To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes. Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build". Reviewed By: mmmulani Differential Revision: D4213120 fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
137 lines
4.1 KiB
Objective-C
137 lines
4.1 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <React/RCTBridge.h>
|
|
#import <React/RCTBridgeModule.h>
|
|
#import <React/RCTInvalidating.h>
|
|
#import <React/RCTRootView.h>
|
|
#import <React/RCTViewManager.h>
|
|
|
|
/**
|
|
* UIManager queue
|
|
*/
|
|
RCT_EXTERN dispatch_queue_t RCTGetUIManagerQueue(void);
|
|
|
|
/**
|
|
* Default name for the UIManager queue
|
|
*/
|
|
RCT_EXTERN char *const RCTUIManagerQueueName;
|
|
|
|
/**
|
|
* Posted right before re-render happens. This is a chance for views to invalidate their state so
|
|
* next render cycle will pick up updated views and layout appropriately.
|
|
*/
|
|
RCT_EXTERN NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification;
|
|
|
|
/**
|
|
* Posted whenever a new root view is registered with RCTUIManager. The userInfo property
|
|
* will contain a RCTUIManagerRootViewKey with the registered root view.
|
|
*/
|
|
RCT_EXTERN NSString *const RCTUIManagerDidRegisterRootViewNotification;
|
|
|
|
/**
|
|
* Posted whenever a root view is removed from the RCTUIManager. The userInfo property
|
|
* will contain a RCTUIManagerRootViewKey with the removed root view.
|
|
*/
|
|
RCT_EXTERN NSString *const RCTUIManagerDidRemoveRootViewNotification;
|
|
|
|
/**
|
|
* Key for the root view property in the above notifications
|
|
*/
|
|
RCT_EXTERN NSString *const RCTUIManagerRootViewKey;
|
|
|
|
@protocol RCTScrollableProtocol;
|
|
|
|
/**
|
|
* The RCTUIManager is the module responsible for updating the view hierarchy.
|
|
*/
|
|
@interface RCTUIManager : NSObject <RCTBridgeModule, RCTInvalidating>
|
|
|
|
/**
|
|
* Register a root view with the RCTUIManager.
|
|
*/
|
|
- (void)registerRootView:(UIView *)rootView withSizeFlexibility:(RCTRootViewSizeFlexibility)sizeFlexibility;
|
|
|
|
/**
|
|
* Gets the view associated with a reactTag.
|
|
*/
|
|
- (UIView *)viewForReactTag:(NSNumber *)reactTag;
|
|
|
|
/**
|
|
* Update the frame of a view. This might be in response to a screen rotation
|
|
* or some other layout event outside of the React-managed view hierarchy.
|
|
*/
|
|
- (void)setFrame:(CGRect)frame forView:(UIView *)view;
|
|
|
|
/**
|
|
* Set the natural size of a view, which is used when no explicit size is set.
|
|
* Use UIViewNoIntrinsicMetric to ignore a dimension.
|
|
*/
|
|
- (void)setIntrinsicContentSize:(CGSize)size forView:(UIView *)view;
|
|
|
|
/**
|
|
* Update the background color of a view. The source of truth for
|
|
* backgroundColor is the shadow view, so if to update backgroundColor from
|
|
* native code you will need to call this method.
|
|
*/
|
|
- (void)setBackgroundColor:(UIColor *)color forView:(UIView *)view;
|
|
|
|
/**
|
|
* Schedule a block to be executed on the UI thread. Useful if you need to execute
|
|
* view logic after all currently queued view updates have completed.
|
|
*/
|
|
- (void)addUIBlock:(RCTViewManagerUIBlock)block;
|
|
|
|
/**
|
|
* Given a reactTag from a component, find its root view, if possible.
|
|
* Otherwise, this will give back nil.
|
|
*
|
|
* @param reactTag the component tag
|
|
* @param completion the completion block that will hand over the rootView, if any.
|
|
*
|
|
*/
|
|
- (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(UIView *view))completion;
|
|
|
|
/**
|
|
* The view that is currently first responder, according to the JS context.
|
|
*/
|
|
+ (UIView *)JSResponder;
|
|
|
|
/**
|
|
* Normally, UI changes are not applied until the complete batch of method
|
|
* invocations from JavaScript to native has completed.
|
|
*
|
|
* Setting this to YES will flush UI changes sooner, which could potentially
|
|
* result in inconsistent UI updates.
|
|
*
|
|
* The default is NO (recommended).
|
|
*/
|
|
@property (atomic, assign) BOOL unsafeFlushUIChangesBeforeBatchEnds;
|
|
|
|
/**
|
|
* In some cases we might want to trigger layout from native side.
|
|
* React won't be aware of this, so we need to make sure it happens.
|
|
*/
|
|
- (void)setNeedsLayout;
|
|
|
|
@end
|
|
|
|
/**
|
|
* This category makes the current RCTUIManager instance available via the
|
|
* RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that
|
|
* need to access the RCTUIManager.
|
|
*/
|
|
@interface RCTBridge (RCTUIManager)
|
|
|
|
@property (nonatomic, readonly) RCTUIManager *uiManager;
|
|
|
|
@end
|