Fixes #62: Use ReactNative rendering methods

This commit is contained in:
Dmitriy Loktev
2016-06-30 11:29:25 +03:00
parent 1f21660a88
commit 0f9a07084c
3 changed files with 29 additions and 6 deletions
+18
View File
@@ -16,6 +16,24 @@
NSMutableDictionary *clipPaths;
}
- (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];
+1 -2
View File
@@ -6,8 +6,7 @@
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "UIView+React.h"
#import "RNSVGCGFCRule.h"
#import "RNSVGSvgView.h"
+10 -4
View File
@@ -12,16 +12,22 @@
@implementation RNSVGNode
- (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