TestsTested | ✗ |
LangLanguage | MUMPSMUMPS |
License | MIT |
ReleasedLast Release | Jan 2015 |
Maintained by Luca Bernardi.
LBBlurredImage is an UIImageView category that permit to set an image and make this blurred.
Here are an example of what you can achieve:
This code must be used with deploy target 6.0+ and under ARC.
If your code doesn't use ARC you can mark this source with the compiler flag -fobjc-arc
UIImageView+LBBlurredImage.{h,m}
and UIImageImage+ImageEffects.{h,m}
in the Additions group into your project and link with Accelerate.framework .#import "UIImageView+LBBlurredImage.h"
where you need it.[self.imageView setImageToBlur:[UIImage imageNamed:@"example"]
blurRadius:kLBBlurredImageDefaultBlurRadius
completionBlock:^(){
NSLog(@"The blurred image has been set");
}];
The generation of the blurred image is made on a background thread, for this reason a completion block is provided. The completionBlock is dispatched on the main thread when the image has been generated and set to the UIImageView.
The code is provided with an example project if you want to see the class in actions.
LBBlurredImage is available under the MIT license. See the LICENSE file for more info.