This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

46 lines
1.1 KiB
Objective-C

// Copyright 2015-present 650 Industries. All rights reserved.
#import <EXLinearGradient/EXLinearGradientManager.h>
#import <EXLinearGradient/EXLinearGradient.h>
#import <UMCore/UMUIManager.h>
@interface EXLinearGradientManager ()
@end
@implementation EXLinearGradientManager
UM_EXPORT_MODULE(ExpoLinearGradientManager);
- (NSString *)viewName
{
return @"ExpoLinearGradient";
}
- (UIView *)view
{
return [[EXLinearGradient alloc] init];
}
UM_VIEW_PROPERTY(colors, NSArray *, EXLinearGradient) {
[view setColors:value];
}
// NOTE: startPoint and endPoint assume that the value is an array with exactly two floats
UM_VIEW_PROPERTY(startPoint, NSArray *, EXLinearGradient) {
CGPoint point = CGPointMake([[value objectAtIndex:0] floatValue], [[value objectAtIndex:1] floatValue]);
[view setStartPoint:point];
}
UM_VIEW_PROPERTY(endPoint, NSArray *, EXLinearGradient) {
CGPoint point = CGPointMake([[value objectAtIndex:0] floatValue], [[value objectAtIndex:1] floatValue]);
[view setEndPoint:point];
}
UM_VIEW_PROPERTY(locations, NSArray *, EXLinearGradient) {
[view setLocations:value];
}
@end