Fixed ART views

Summary: Fixed ART views, which were broken by the zIndex diff

Reviewed By: wwjholmes

Differential Revision: D3403679

fbshipit-source-id: cc3cdccd19c21223ce6bddeda3d914937ecb73b6
This commit is contained in:
Nick Lockwood 2016-06-08 00:06:08 -07:00 committed by Facebook Github Bot 0
parent b29c938312
commit b0fed416cb
3 changed files with 29 additions and 6 deletions

View File

@ -7,8 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "UIView+React.h"
/**
* ART nodes are implemented as empty UIViews but this is just an implementation detail to fit

View File

@ -13,16 +13,22 @@
@implementation ARTNode
- (void)insertSubview:(UIView *)subview atIndex:(NSInteger)index
- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
{
[super insertReactSubview:subview atIndex:atIndex];
[self insertSubview:subview atIndex:atIndex];
[self invalidate];
[super insertSubview:subview atIndex:index];
}
- (void)removeFromSuperview
- (void)removeReactSubview:(UIView *)subview
{
[super removeReactSubview:subview];
[self invalidate];
[super removeFromSuperview];
}
- (void)didUpdateReactSubviews
{
// Do nothing, as subviews are inserted by insertReactSubview:
}
- (void)setOpacity:(CGFloat)opacity

View File

@ -14,6 +14,24 @@
@implementation ARTSurfaceView
- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
{
[super insertReactSubview:subview atIndex:atIndex];
[self insertSubview:subview atIndex:atIndex];
[self invalidate];
}
- (void)removeReactSubview:(UIView *)subview
{
[super removeReactSubview:subview];
[self invalidate];
}
- (void)didUpdateReactSubviews
{
// Do nothing, as subviews are inserted by insertReactSubview:
}
- (void)invalidate
{
[self setNeedsDisplay];