diff --git a/FXBlurView/FXBlurView.m b/FXBlurView/FXBlurView.m index b18883a..91fda13 100755 --- a/FXBlurView/FXBlurView.m +++ b/FXBlurView/FXBlurView.m @@ -125,8 +125,7 @@ - (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)itera //apply tint if (tintColor && CGColorGetAlpha(tintColor.CGColor) > 0.0f) { - CGContextSetFillColorWithColor(ctx, [tintColor colorWithAlphaComponent:0.25].CGColor); - CGContextSetBlendMode(ctx, kCGBlendModePlusLighter); + CGContextSetFillColorWithColor(ctx, tintColor.CGColor); CGContextFillRect(ctx, CGRectMake(0, 0, buffer1.width, buffer1.height)); } @@ -576,7 +575,7 @@ - (void)displayLayer:(__unused CALayer *)layer - (UIImage *)snapshotOfUnderlyingView { - __strong FXBlurLayer *blurLayer = [self blurPresentationLayer]; + __strong FXBlurLayer *blurLayer = [self blurLayer]; __strong CALayer *underlyingLayer = [self underlyingLayer]; CGRect bounds = [blurLayer convertRect:blurLayer.bounds toLayer:underlyingLayer]; @@ -630,7 +629,7 @@ - (UIImage *)snapshotOfUnderlyingView - (NSArray *)hideEmptyLayers:(CALayer *)layer { NSMutableArray *layers = [NSMutableArray array]; - if (CGRectIsEmpty(layer.bounds)) + if (CGRectIsEmpty(layer.bounds) && !layer.hidden) { layer.hidden = YES; [layers addObject:layer]; @@ -701,9 +700,8 @@ - (void)updateAsynchronously:(BOOL)async completion:(void (^)())completion { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - UIImage *blurredImage = [self blurredSnapshot:snapshot radius:self.blurRadius]; dispatch_sync(dispatch_get_main_queue(), ^{ - + UIImage *blurredImage = [self blurredSnapshot:snapshot radius:self.blurRadius]; [self setLayerContents:blurredImage]; if (completion) completion(); });