react-native-blur/ios/BlurAmount.m

42 lines
771 B
Mathematica
Raw Normal View History

2016-12-21 11:31:08 +00:00
#import "BlurAmount.h"
#import <objc/runtime.h>
@interface UIBlurEffect (Protected)
@property (nonatomic, readonly) id effectSettings;
@end
@implementation BlurAmount
NSNumber *localBlurAmount;
+ (instancetype)effectWithStyle:(UIBlurEffectStyle)style
{
id result = [super effectWithStyle:style];
object_setClass(result, self);
return result;
}
- (id)effectSettings
{
id settings = [super effectSettings];
2016-10-29 15:14:04 +00:00
[settings setValue:localBlurAmount forKey:@"blurRadius"];
return settings;
}
- (id)copyWithZone:(NSZone*)zone
{
id result = [super copyWithZone:zone];
object_setClass(result, [self class]);
return result;
}
+ (id)updateBlurAmount:(NSNumber*)blurAmount
{
localBlurAmount = blurAmount;
return blurAmount;
}
@end