mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 15:44:24 +00:00
refactor Use and Defs element with native code support(iOS)
This commit is contained in:
@@ -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"
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user