A UIView subclass which applies image effects to a given image.
Image affects (blur, saturation) are applied to a base image asynchronously and is intended to be used for near real time application.
(please note the image quality is much better than the above gif, as can be seen below)
- Make changes to properties animatable (using Core Animation).
If you're using CocoPods it's as simple as adding this to your Podfile
:
pod 'GRKBlurView'
Use as you would any other UIView, and simply configure appropriate to your needs.
In the simplest case, all you need supply is the base targetImage
and a blurRadius
as
seen below, however, because of asynchronous updates interaction with the effects is
possible and performant.
@property (nonatomic,weak) IBOutlet GRKBlurView *blurView;
- (void)viewDidLoad
{
[super viewDidLoad];
self.blurView.targetImage = [UIImage imageNamed:@"test"];
self.blurView.blurRadius = 30.0f;
}
There is a convenience method to capture a view hierarchy as an image and use that as the target image:
- (void)setTargetImageFromView:(UIView *)targetView;
Also please refer to the included GRKBlurViewTestApp for more robust examples.
Additional documentation is available in GRKBlurView.h
.
- This work makes use of WWDC 2013 UIImageEffects sample code provided by Apple
- This work makes use of snapshot sample code provided by Apple
- This work is licensed under the Creative Commons Attribution 3.0 Unported License. Please see the included LICENSE.txt for complete details.
A professional iOS engineer by day, my name is Levi Brown. Authoring a technical blog grokin.gs, I am reachable via:
Twitter @levigroker
App.net @levigroker
Email levigroker@gmail.com
Your constructive comments and feedback are always welcome.