refactor Use and Defs element with native code support(iOS)

This commit is contained in:
Horcrux
2016-07-19 23:09:51 +08:00
parent 4eddfc6885
commit dd6cb80e84
37 changed files with 535 additions and 282 deletions
+15
View File
@@ -0,0 +1,15 @@
/**
* Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RCTViewManager.h"
@interface RNSVGDefinationManager : RCTViewManager
@end
#import "RNSVGNode.h"
+31
View File
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RNSVGDefination.h"
#import "RNSVGDefinationManager.h"
@implementation RNSVGDefinationManager
RCT_EXPORT_MODULE()
- (RNSVGDefination *)node
{
return [RNSVGDefination new];
}
- (UIView *)view
{
return [self node];
}
- (RCTShadowView *)shadowView
{
return nil;
}
@end
+2 -1
View File
@@ -29,8 +29,9 @@ RCT_EXPORT_MODULE()
return nil;
}
RCT_EXPORT_VIEW_PROPERTY(name, NSString)
RCT_EXPORT_VIEW_PROPERTY(opacity, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(trans, CGAffineTransform)
RCT_EXPORT_VIEW_PROPERTY(transform, CGAffineTransform)
RCT_EXPORT_VIEW_PROPERTY(clipPathRef, NSString)
RCT_EXPORT_VIEW_PROPERTY(responsible, BOOL)
@@ -8,6 +8,6 @@
#import "RNSVGRenderableManager.h"
@interface RNSVGShapeManager : RNSVGRenderableManager
@interface RNSVGUseManager : RNSVGRenderableManager
@end
@@ -6,20 +6,19 @@
* LICENSE file in the root directory of this source tree.
*/
#import "RNSVGShapeManager.h"
#import "RNSVGUseManager.h"
#import "RNSVGUse.h"
#import "RNSVGShape.h"
#import "RCTConvert+RNSVG.h"
@implementation RNSVGShapeManager
@implementation RNSVGUseManager
RCT_EXPORT_MODULE()
- (RNSVGRenderable *)node
- (RNSVGNode *)node
{
return [RNSVGShape new];
return [RNSVGUse new];
}
RCT_EXPORT_VIEW_PROPERTY(shape, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(href, NSString)
@end