2015-03-23 13:28:42 -07:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2015-08-06 15:44:15 -07:00
|
|
|
#import <CoreGraphics/CoreGraphics.h>
|
|
|
|
|
2015-02-19 20:10:52 -08:00
|
|
|
/**
|
2015-08-06 15:44:15 -07:00
|
|
|
* Logical node in a tree of application components. Both `ShadowView` and
|
|
|
|
* `UIView` conforms to this. Allows us to write utilities that reason about
|
|
|
|
* trees generally.
|
2015-02-19 20:10:52 -08:00
|
|
|
*/
|
2015-08-06 15:44:15 -07:00
|
|
|
@protocol RCTComponent <NSObject>
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2015-03-01 15:33:55 -08:00
|
|
|
@property (nonatomic, copy) NSNumber *reactTag;
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2015-08-06 15:44:15 -07:00
|
|
|
- (void)insertReactSubview:(id<RCTComponent>)subview atIndex:(NSInteger)atIndex;
|
|
|
|
- (void)removeReactSubview:(id<RCTComponent>)subview;
|
2015-07-31 11:23:29 -07:00
|
|
|
- (NSArray *)reactSubviews;
|
2015-08-06 15:44:15 -07:00
|
|
|
- (id<RCTComponent>)reactSuperview;
|
2015-02-19 20:10:52 -08:00
|
|
|
- (NSNumber *)reactTagAtPoint:(CGPoint)point;
|
|
|
|
|
2015-03-24 17:37:03 -07:00
|
|
|
// View/ShadowView is a root view
|
2015-02-19 20:10:52 -08:00
|
|
|
- (BOOL)isReactRootView;
|
|
|
|
|
|
|
|
@optional
|
|
|
|
|
|
|
|
// TODO: Deprecate this
|
2015-03-01 15:33:55 -08:00
|
|
|
// This method is called after layout has been performed for all views known
|
|
|
|
// to the RCTViewManager. It is only called on UIViews, not shadow views.
|
2015-02-19 20:10:52 -08:00
|
|
|
- (void)reactBridgeDidFinishTransaction;
|
|
|
|
|
|
|
|
@end
|
2015-03-05 16:36:41 -08:00
|
|
|
|
|
|
|
// TODO: this is kinda dumb - let's come up with a
|
2015-04-27 13:55:01 -07:00
|
|
|
// better way of identifying root React views please!
|
2015-07-31 11:23:29 -07:00
|
|
|
static inline BOOL RCTIsReactRootView(NSNumber *reactTag)
|
|
|
|
{
|
2015-03-05 16:36:41 -08:00
|
|
|
return reactTag.integerValue % 10 == 1;
|
|
|
|
}
|