2016-12-21 11:31:08 +00:00
|
|
|
#import "BlurAmount.h"
|
2016-10-27 07:19:43 +00:00
|
|
|
#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"];
|
2016-10-27 07:19:43 +00:00
|
|
|
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
|