├── .gitignore ├── ANBlurredImageView.podspec ├── ANBlurredImageView ├── ANBlurredImageView.h ├── ANBlurredImageView.m ├── UIImage+BoxBlur.h └── UIImage+BoxBlur.m ├── ANBlurredImageViewDemo.xcodeproj └── project.pbxproj ├── ANBlurredImageViewDemo ├── ANAppDelegate.h ├── ANAppDelegate.m ├── ANBlurredImageViewDemo-Info.plist ├── ANBlurredImageViewDemo-Prefix.pch ├── ANViewController.h ├── ANViewController.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── en.lproj │ └── InfoPlist.strings ├── main.m └── nature.jpg ├── LICENSE └── Readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ -------------------------------------------------------------------------------- /ANBlurredImageView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ANBlurredImageView" 3 | s.version = "0.0.2" 4 | s.summary = "Animated blur-in and blur-out on UIImageView." 5 | s.homepage = "https://github.com/aaronn/ANBlurredImageView" 6 | s.license = { :type => 'BSD', :text => 'ANBlurredImageView is licensed under the BSD license.'} 7 | s.author = { "aaronykng" => "hi@aaron.ng" } 8 | s.social_media_url = "http://twitter.com/aaronykng" 9 | s.platform = :ios, "7.0" 10 | s.source = { :git => "https://github.com/aaronn/ANBlurredImageView.git", :tag => "0.0.2" } 11 | s.source_files = "ANBlurredImageView/*.{h,m}" 12 | end 13 | -------------------------------------------------------------------------------- /ANBlurredImageView/ANBlurredImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ANBlurredImageView.h 3 | // 4 | // Created by Aaron Ng on 1/4/14. 5 | // Copyright (c) 2014 Delve. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface ANBlurredImageView : UIImageView 11 | 12 | /** 13 | Our base image, stored because we replace self.image when blurring in and out. 14 | */ 15 | @property (strong, nonatomic) UIImage *baseImage; 16 | 17 | 18 | /** 19 | The array of blurred images to cycle through. 20 | */ 21 | @property (strong) NSMutableArray *framesArray; 22 | 23 | /** 24 | A reversed version of framesArray. Populates by inserting at 0 each time the normal framesArray is generated. 25 | */ 26 | @property (strong) NSMutableArray *framesReverseArray; 27 | 28 | /** 29 | Number of frames, default value is 5. Increasing this can cause your app to have huge memory issues. Lower is better, especially when dealing with really fast animations. Nobody will notice! 30 | */ 31 | @property (assign) NSInteger framesCount; 32 | 33 | /** 34 | The blur amount. Default amount is 0.1f A CGFloat from 0.0f to 1.0f. 35 | */ 36 | @property (nonatomic) CGFloat blurAmount; 37 | 38 | /** 39 | The blur's tint color. Fades the tint in with the blur. Set the alpha as the final blur alpha. 40 | */ 41 | @property (strong) UIColor *blurTintColor; 42 | 43 | 44 | /** 45 | Regenerates your frames. Only call this manually when absolutely necessary, since all frames are already pre-calculated on load. This doubles the amount of work but is necessary if the values aren't configured immediately on load. 46 | */ 47 | -(void)generateBlurFramesWithCompletion:(void(^)())completion; 48 | 49 | /** 50 | Blur in your image with the specificed duration. blurAmount isn't settable here because the frames need to be preloaded. Blur is set in a background thread, if blur isn't ready then nothing happens. 51 | @param duration A specified duration in a float. 52 | */ 53 | -(void)blurInAnimationWithDuration:(CGFloat)duration; 54 | 55 | 56 | /** 57 | Blur out your image with the specificed duration. blurAmount isn't settable here because the frames need to be preloaded. Blur is set in a background thread, if blur isn't ready then nothing happens. 58 | @param duration A specified duration in a float. 59 | */ 60 | -(void)blurOutAnimationWithDuration:(CGFloat)duration; 61 | 62 | 63 | /** 64 | Blur in an image with a duration and a callback. 65 | @param duration A specified duration in a float. 66 | @param completion A codeblock timed to the single-run animationTime. 67 | */ 68 | -(void)blurInAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion; 69 | 70 | 71 | /** 72 | Blur out an image with a duration and a callback. 73 | @param duration A specified duration in a float. 74 | @param completion A codeblock timed to the single-run animationTime. 75 | */ 76 | -(void)blurOutAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion; 77 | 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /ANBlurredImageView/ANBlurredImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ANBlurredImageView.m 3 | // 4 | // Created by Aaron Ng on 1/4/14. 5 | // Copyright (c) 2014 Delve. All rights reserved. 6 | // 7 | 8 | #import "ANBlurredImageView.h" 9 | #import "UIImage+BoxBlur.h" 10 | 11 | @implementation ANBlurredImageView 12 | 13 | - (id)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | // Initialization code 18 | } 19 | return self; 20 | } 21 | 22 | -(void)layoutSubviews{ 23 | [super layoutSubviews]; 24 | 25 | _baseImage = self.image; 26 | [self generateBlurFramesWithCompletion:^{}]; 27 | 28 | // Defaults 29 | self.animationDuration = 0.1f; 30 | self.animationRepeatCount = 1; 31 | } 32 | 33 | // Downsamples the image so we avoid needing to blur a huge image. 34 | -(UIImage*)downsampleImage{ 35 | NSData *imageAsData = UIImageJPEGRepresentation(self.baseImage, 0.001); 36 | UIImage *downsampledImaged = [UIImage imageWithData:imageAsData]; 37 | return downsampledImaged; 38 | } 39 | 40 | #pragma mark - 41 | #pragma mark Animation Methods 42 | 43 | 44 | -(void)generateBlurFramesWithCompletion:(void(^)())completion{ 45 | 46 | // Reset our arrays. Generate our reverse array at the same time to save work later on blurOut. 47 | _framesArray = [[NSMutableArray alloc]init]; 48 | _framesReverseArray = [[NSMutableArray alloc]init]; 49 | 50 | // Our default number of frames, if none is provided. 51 | // Keep this low to prevent huge performance issues. 52 | NSInteger frames = 5; 53 | if (_framesCount) 54 | frames = _framesCount; 55 | 56 | if (!_blurTintColor) 57 | _blurTintColor = [UIColor clearColor]; 58 | 59 | // Set our blur amount, 0-1 if availabile. 60 | // If < 0, reset to lowest blur. If > 1, reset to highest blur. 61 | CGFloat blurLevel = _blurAmount; 62 | if (_blurAmount < 0.0f || !_blurAmount) 63 | blurLevel = 0.1f; 64 | 65 | if (_blurAmount > 1.0f) 66 | blurLevel = 1.0f; 67 | 68 | UIImage *downsampledImage = [self downsampleImage]; 69 | 70 | // Create our array, set each image as a spot in the array. 71 | for (int i = 0; i < frames; i++){ 72 | UIImage *blurredImage = [downsampledImage drn_boxblurImageWithBlur:((CGFloat)i/frames)*blurLevel withTintColor:[_blurTintColor colorWithAlphaComponent:(CGFloat)i/frames * CGColorGetAlpha(_blurTintColor.CGColor)]]; 73 | 74 | if (blurredImage){ 75 | // Our normal animation. 76 | [_framesArray addObject:blurredImage]; 77 | // Our reverse animation. 78 | [_framesReverseArray insertObject:blurredImage atIndex:0]; 79 | } 80 | 81 | } 82 | completion(); 83 | 84 | } 85 | 86 | -(void)blurInAnimationWithDuration:(CGFloat)duration{ 87 | 88 | // Set our duration. 89 | self.animationDuration = duration; 90 | 91 | // Set our forwards image array; 92 | self.animationImages = _framesArray; 93 | 94 | // Set our image to the last image to make sure it's permanent on animation end. 95 | [self setImage:[_framesArray lastObject]]; 96 | 97 | // BOOM! Blur in. 98 | [self startAnimating]; 99 | } 100 | 101 | -(void)blurOutAnimationWithDuration:(CGFloat)duration{ 102 | 103 | // Set our duration. 104 | self.animationDuration = duration; 105 | 106 | // Set our reverse image array. 107 | self.animationImages = _framesReverseArray; 108 | 109 | // Set our end frame. 110 | [self setImage:_baseImage]; 111 | 112 | // BOOM! Blur out. 113 | [self startAnimating]; 114 | } 115 | 116 | -(void)blurInAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion{ 117 | 118 | // Call our blurout with the correct duration. 119 | [self blurInAnimationWithDuration:duration]; 120 | 121 | // Our callback 122 | // Via http://stackoverflow.com/questions/9283270/access-method-after-uiimageview-animation-finish 123 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, self.animationDuration * NSEC_PER_SEC); 124 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 125 | if(completion){ 126 | completion(); 127 | } 128 | }); 129 | } 130 | 131 | -(void)blurOutAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion{ 132 | 133 | // Call our blurout with the correct duration. 134 | [self blurOutAnimationWithDuration:duration]; 135 | 136 | // Our callback 137 | // Via http://stackoverflow.com/questions/9283270/access-method-after-uiimageview-animation-finish 138 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, self.animationDuration * NSEC_PER_SEC); 139 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 140 | if(completion){ 141 | completion(); 142 | } 143 | }); 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /ANBlurredImageView/UIImage+BoxBlur.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+BoxBlur.h 3 | // LiveBlurView 4 | // 5 | // Created by Alex Usbergo on 7/3/13. 6 | // Copyright (c) 2013 Alex Usbergo. All rights reserved. 7 | // 8 | // algorithm from: http://indieambitions.com/idevblogaday/perform-blur-vimage-accelerate-framework-tutorial/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+IndieAmbitions+%28Indie+Ambitions%29 9 | 10 | 11 | #import 12 | 13 | @interface UIImage (BoxBlur) 14 | 15 | /* blur the current image with a box blur algoritm */ 16 | - (UIImage*)drn_boxblurImageWithBlur:(CGFloat)blur; 17 | 18 | /* blur the current image with a box blur algoritm and tint with a color */ 19 | - (UIImage*)drn_boxblurImageWithBlur:(CGFloat)blur withTintColor:(UIColor*)tintColor; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ANBlurredImageView/UIImage+BoxBlur.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+BoxBlur.m 3 | // LiveBlurView 4 | // 5 | // Created by Alex Usbergo on 7/3/13. 6 | // Copyright (c) 2013 Alex Usbergo. All rights reserved. 7 | // 8 | 9 | #import "UIImage+BoxBlur.h" 10 | #import 11 | #import 12 | 13 | @implementation UIImage (BoxBlur) 14 | 15 | /* blur the current image with a box blur algoritm */ 16 | - (UIImage*)drn_boxblurImageWithBlur:(CGFloat)blur 17 | { 18 | if (blur < 0.f || blur > 1.f) { 19 | blur = 0.5f; 20 | } 21 | int boxSize = (int)(blur * 40); 22 | boxSize = boxSize - (boxSize % 2) + 1; 23 | 24 | CGImageRef img = self.CGImage; 25 | vImage_Buffer inBuffer, outBuffer; 26 | vImage_Error error; 27 | void *pixelBuffer; 28 | 29 | //create vImage_Buffer with data from CGImageRef 30 | CGDataProviderRef inProvider = CGImageGetDataProvider(img); 31 | CFDataRef inBitmapData = CGDataProviderCopyData(inProvider); 32 | 33 | inBuffer.width = CGImageGetWidth(img); 34 | inBuffer.height = CGImageGetHeight(img); 35 | inBuffer.rowBytes = CGImageGetBytesPerRow(img); 36 | 37 | inBuffer.data = (void*)CFDataGetBytePtr(inBitmapData); 38 | 39 | //create vImage_Buffer for output 40 | pixelBuffer = malloc(CGImageGetBytesPerRow(img) * CGImageGetHeight(img)); 41 | 42 | if(pixelBuffer == NULL) 43 | NSLog(@"No pixelbuffer"); 44 | 45 | outBuffer.data = pixelBuffer; 46 | outBuffer.width = CGImageGetWidth(img); 47 | outBuffer.height = CGImageGetHeight(img); 48 | outBuffer.rowBytes = CGImageGetBytesPerRow(img); 49 | 50 | // Create a third buffer for intermediate processing 51 | /*void *pixelBuffer2 = malloc(CGImageGetBytesPerRow(img) * CGImageGetHeight(img)); 52 | vImage_Buffer outBuffer2; 53 | outBuffer2.data = pixelBuffer2; 54 | outBuffer2.width = CGImageGetWidth(img); 55 | outBuffer2.height = CGImageGetHeight(img); 56 | outBuffer2.rowBytes = CGImageGetBytesPerRow(img);*/ 57 | 58 | //perform convolution 59 | error = vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend) 60 | ?: vImageBoxConvolve_ARGB8888(&outBuffer, &inBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend) 61 | ?: vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend); 62 | 63 | if (error) { 64 | NSLog(@"error from convolution %ld", error); 65 | } 66 | 67 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 68 | CGContextRef ctx = CGBitmapContextCreate(outBuffer.data, 69 | outBuffer.width, 70 | outBuffer.height, 71 | 8, 72 | outBuffer.rowBytes, 73 | colorSpace, 74 | (CGBitmapInfo)kCGImageAlphaNoneSkipLast); 75 | CGImageRef imageRef = CGBitmapContextCreateImage (ctx); 76 | UIImage *returnImage = [UIImage imageWithCGImage:imageRef]; 77 | 78 | //clean up 79 | CGContextRelease(ctx); 80 | CGColorSpaceRelease(colorSpace); 81 | 82 | free(pixelBuffer); 83 | //free(pixelBuffer2); 84 | 85 | CFRelease(inBitmapData); 86 | 87 | CGImageRelease(imageRef); 88 | 89 | 90 | 91 | return returnImage; 92 | } 93 | 94 | - (UIImage*)drn_boxblurImageWithBlur:(CGFloat)blur withTintColor:(UIColor *)tintColor 95 | { 96 | if (blur < 0.f || blur > 1.f) { 97 | blur = 0.5f; 98 | } 99 | int boxSize = (int)(blur * 40); 100 | boxSize = boxSize - (boxSize % 2) + 1; 101 | 102 | CGImageRef img = self.CGImage; 103 | vImage_Buffer inBuffer, outBuffer; 104 | vImage_Error error; 105 | void *pixelBuffer; 106 | 107 | 108 | //create vImage_Buffer with data from CGImageRef 109 | CGDataProviderRef inProvider = CGImageGetDataProvider(img); 110 | CFDataRef inBitmapData = CGDataProviderCopyData(inProvider); 111 | 112 | inBuffer.width = CGImageGetWidth(img); 113 | inBuffer.height = CGImageGetHeight(img); 114 | inBuffer.rowBytes = CGImageGetBytesPerRow(img); 115 | 116 | inBuffer.data = (void*)CFDataGetBytePtr(inBitmapData); 117 | 118 | //create vImage_Buffer for output 119 | pixelBuffer = malloc(CGImageGetBytesPerRow(img) * CGImageGetHeight(img)); 120 | 121 | if(pixelBuffer == NULL) 122 | NSLog(@"No pixelbuffer"); 123 | 124 | outBuffer.data = pixelBuffer; 125 | outBuffer.width = CGImageGetWidth(img); 126 | outBuffer.height = CGImageGetHeight(img); 127 | outBuffer.rowBytes = CGImageGetBytesPerRow(img); 128 | 129 | // Create a third buffer for intermediate processing 130 | /*void *pixelBuffer2 = malloc(CGImageGetBytesPerRow(img) * CGImageGetHeight(img)); 131 | vImage_Buffer outBuffer2; 132 | outBuffer2.data = pixelBuffer2; 133 | outBuffer2.width = CGImageGetWidth(img); 134 | outBuffer2.height = CGImageGetHeight(img); 135 | outBuffer2.rowBytes = CGImageGetBytesPerRow(img);*/ 136 | 137 | //perform convolution 138 | error = vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend) 139 | ?: vImageBoxConvolve_ARGB8888(&outBuffer, &inBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend) 140 | ?: vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend); 141 | 142 | if (error) { 143 | NSLog(@"error from convolution %ld", error); 144 | } 145 | 146 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 147 | CGContextRef ctx = CGBitmapContextCreate(outBuffer.data, 148 | outBuffer.width, 149 | outBuffer.height, 150 | 8, 151 | outBuffer.rowBytes, 152 | colorSpace, 153 | (CGBitmapInfo)kCGImageAlphaNoneSkipLast); 154 | 155 | CGRect imageRect = {CGPointZero, self.size}; 156 | 157 | // Add in color tint. 158 | if (tintColor) { 159 | CGContextSaveGState(ctx); 160 | CGContextSetFillColorWithColor(ctx, tintColor.CGColor); 161 | CGContextFillRect(ctx, imageRect); 162 | CGContextRestoreGState(ctx); 163 | } 164 | 165 | CGImageRef imageRef = CGBitmapContextCreateImage (ctx); 166 | 167 | UIImage *returnImage = [UIImage imageWithCGImage:imageRef]; 168 | 169 | //clean up 170 | CGContextRelease(ctx); 171 | CGColorSpaceRelease(colorSpace); 172 | 173 | free(pixelBuffer); 174 | //free(pixelBuffer2); 175 | 176 | CFRelease(inBitmapData); 177 | 178 | CGImageRelease(imageRef); 179 | 180 | return returnImage; 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9356E3081879654700FF19B0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E3071879654700FF19B0 /* Foundation.framework */; }; 11 | 9356E30A1879654700FF19B0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E3091879654700FF19B0 /* CoreGraphics.framework */; }; 12 | 9356E30C1879654700FF19B0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E30B1879654700FF19B0 /* UIKit.framework */; }; 13 | 9356E3121879654700FF19B0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9356E3101879654700FF19B0 /* InfoPlist.strings */; }; 14 | 9356E3141879654700FF19B0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9356E3131879654700FF19B0 /* main.m */; }; 15 | 9356E3181879654700FF19B0 /* ANAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9356E3171879654700FF19B0 /* ANAppDelegate.m */; }; 16 | 9356E31B1879654700FF19B0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9356E3191879654700FF19B0 /* Main.storyboard */; }; 17 | 9356E31E1879654700FF19B0 /* ANViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9356E31D1879654700FF19B0 /* ANViewController.m */; }; 18 | 9356E3201879654700FF19B0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9356E31F1879654700FF19B0 /* Images.xcassets */; }; 19 | 9356E3271879654700FF19B0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E3261879654700FF19B0 /* XCTest.framework */; }; 20 | 9356E3281879654700FF19B0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E3071879654700FF19B0 /* Foundation.framework */; }; 21 | 9356E3291879654700FF19B0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E30B1879654700FF19B0 /* UIKit.framework */; }; 22 | 9356E3431879656B00FF19B0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E3421879656B00FF19B0 /* QuartzCore.framework */; }; 23 | 9356E3451879656E00FF19B0 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9356E3441879656E00FF19B0 /* Accelerate.framework */; }; 24 | 9356E347187967B500FF19B0 /* nature.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9356E346187967B500FF19B0 /* nature.jpg */; }; 25 | 938C8C20187BB4480040F120 /* ANBlurredImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 938C8C1D187BB4480040F120 /* ANBlurredImageView.m */; }; 26 | 938C8C21187BB4480040F120 /* UIImage+BoxBlur.m in Sources */ = {isa = PBXBuildFile; fileRef = 938C8C1F187BB4480040F120 /* UIImage+BoxBlur.m */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 9356E32A1879654700FF19B0 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 9356E2FC1879654700FF19B0 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 9356E3031879654700FF19B0; 35 | remoteInfo = ANBlurredImageViewDemo; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 9356E3041879654700FF19B0 /* ANBlurredImageViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ANBlurredImageViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 9356E3071879654700FF19B0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 42 | 9356E3091879654700FF19B0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 43 | 9356E30B1879654700FF19B0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 44 | 9356E30F1879654700FF19B0 /* ANBlurredImageViewDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ANBlurredImageViewDemo-Info.plist"; sourceTree = ""; }; 45 | 9356E3111879654700FF19B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 46 | 9356E3131879654700FF19B0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 47 | 9356E3151879654700FF19B0 /* ANBlurredImageViewDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ANBlurredImageViewDemo-Prefix.pch"; sourceTree = ""; }; 48 | 9356E3161879654700FF19B0 /* ANAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANAppDelegate.h; sourceTree = ""; }; 49 | 9356E3171879654700FF19B0 /* ANAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANAppDelegate.m; sourceTree = ""; }; 50 | 9356E31A1879654700FF19B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 9356E31C1879654700FF19B0 /* ANViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANViewController.h; sourceTree = ""; }; 52 | 9356E31D1879654700FF19B0 /* ANViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANViewController.m; sourceTree = ""; }; 53 | 9356E31F1879654700FF19B0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 54 | 9356E3251879654700FF19B0 /* ANBlurredImageViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ANBlurredImageViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 9356E3261879654700FF19B0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 56 | 9356E3421879656B00FF19B0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 57 | 9356E3441879656E00FF19B0 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 58 | 9356E346187967B500FF19B0 /* nature.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature.jpg; sourceTree = ""; }; 59 | 938C8C1C187BB4480040F120 /* ANBlurredImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ANBlurredImageView.h; path = ANBlurredImageView/ANBlurredImageView.h; sourceTree = SOURCE_ROOT; }; 60 | 938C8C1D187BB4480040F120 /* ANBlurredImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ANBlurredImageView.m; path = ANBlurredImageView/ANBlurredImageView.m; sourceTree = SOURCE_ROOT; }; 61 | 938C8C1E187BB4480040F120 /* UIImage+BoxBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+BoxBlur.h"; path = "ANBlurredImageView/UIImage+BoxBlur.h"; sourceTree = SOURCE_ROOT; }; 62 | 938C8C1F187BB4480040F120 /* UIImage+BoxBlur.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+BoxBlur.m"; path = "ANBlurredImageView/UIImage+BoxBlur.m"; sourceTree = SOURCE_ROOT; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 9356E3011879654700FF19B0 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 9356E3451879656E00FF19B0 /* Accelerate.framework in Frameworks */, 71 | 9356E3431879656B00FF19B0 /* QuartzCore.framework in Frameworks */, 72 | 9356E30A1879654700FF19B0 /* CoreGraphics.framework in Frameworks */, 73 | 9356E30C1879654700FF19B0 /* UIKit.framework in Frameworks */, 74 | 9356E3081879654700FF19B0 /* Foundation.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | 9356E3221879654700FF19B0 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | 9356E3271879654700FF19B0 /* XCTest.framework in Frameworks */, 83 | 9356E3291879654700FF19B0 /* UIKit.framework in Frameworks */, 84 | 9356E3281879654700FF19B0 /* Foundation.framework in Frameworks */, 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 9356E2FB1879654700FF19B0 = { 92 | isa = PBXGroup; 93 | children = ( 94 | 9356E30D1879654700FF19B0 /* ANBlurredImageViewDemo */, 95 | 9356E3061879654700FF19B0 /* Frameworks */, 96 | 9356E3051879654700FF19B0 /* Products */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | 9356E3051879654700FF19B0 /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 9356E3041879654700FF19B0 /* ANBlurredImageViewDemo.app */, 104 | 9356E3251879654700FF19B0 /* ANBlurredImageViewDemoTests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | 9356E3061879654700FF19B0 /* Frameworks */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 9356E3441879656E00FF19B0 /* Accelerate.framework */, 113 | 9356E3421879656B00FF19B0 /* QuartzCore.framework */, 114 | 9356E3071879654700FF19B0 /* Foundation.framework */, 115 | 9356E3091879654700FF19B0 /* CoreGraphics.framework */, 116 | 9356E30B1879654700FF19B0 /* UIKit.framework */, 117 | 9356E3261879654700FF19B0 /* XCTest.framework */, 118 | ); 119 | name = Frameworks; 120 | sourceTree = ""; 121 | }; 122 | 9356E30D1879654700FF19B0 /* ANBlurredImageViewDemo */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 9356E346187967B500FF19B0 /* nature.jpg */, 126 | 9356E35718796FF400FF19B0 /* Classes */, 127 | 9356E3161879654700FF19B0 /* ANAppDelegate.h */, 128 | 9356E3171879654700FF19B0 /* ANAppDelegate.m */, 129 | 9356E3191879654700FF19B0 /* Main.storyboard */, 130 | 9356E31C1879654700FF19B0 /* ANViewController.h */, 131 | 9356E31D1879654700FF19B0 /* ANViewController.m */, 132 | 9356E31F1879654700FF19B0 /* Images.xcassets */, 133 | 9356E30E1879654700FF19B0 /* Supporting Files */, 134 | ); 135 | path = ANBlurredImageViewDemo; 136 | sourceTree = ""; 137 | }; 138 | 9356E30E1879654700FF19B0 /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 9356E30F1879654700FF19B0 /* ANBlurredImageViewDemo-Info.plist */, 142 | 9356E3101879654700FF19B0 /* InfoPlist.strings */, 143 | 9356E3131879654700FF19B0 /* main.m */, 144 | 9356E3151879654700FF19B0 /* ANBlurredImageViewDemo-Prefix.pch */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | 9356E35718796FF400FF19B0 /* Classes */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 938C8C1C187BB4480040F120 /* ANBlurredImageView.h */, 153 | 938C8C1D187BB4480040F120 /* ANBlurredImageView.m */, 154 | 938C8C1E187BB4480040F120 /* UIImage+BoxBlur.h */, 155 | 938C8C1F187BB4480040F120 /* UIImage+BoxBlur.m */, 156 | ); 157 | name = Classes; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | 9356E3031879654700FF19B0 /* ANBlurredImageViewDemo */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = 9356E3361879654700FF19B0 /* Build configuration list for PBXNativeTarget "ANBlurredImageViewDemo" */; 166 | buildPhases = ( 167 | 9356E3001879654700FF19B0 /* Sources */, 168 | 9356E3011879654700FF19B0 /* Frameworks */, 169 | 9356E3021879654700FF19B0 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = ANBlurredImageViewDemo; 176 | productName = ANBlurredImageViewDemo; 177 | productReference = 9356E3041879654700FF19B0 /* ANBlurredImageViewDemo.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | 9356E3241879654700FF19B0 /* ANBlurredImageViewDemoTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 9356E3391879654700FF19B0 /* Build configuration list for PBXNativeTarget "ANBlurredImageViewDemoTests" */; 183 | buildPhases = ( 184 | 9356E3211879654700FF19B0 /* Sources */, 185 | 9356E3221879654700FF19B0 /* Frameworks */, 186 | 9356E3231879654700FF19B0 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | 9356E32B1879654700FF19B0 /* PBXTargetDependency */, 192 | ); 193 | name = ANBlurredImageViewDemoTests; 194 | productName = ANBlurredImageViewDemoTests; 195 | productReference = 9356E3251879654700FF19B0 /* ANBlurredImageViewDemoTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | 9356E2FC1879654700FF19B0 /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | CLASSPREFIX = AN; 205 | LastUpgradeCheck = 0500; 206 | ORGANIZATIONNAME = Delve; 207 | TargetAttributes = { 208 | 9356E3241879654700FF19B0 = { 209 | TestTargetID = 9356E3031879654700FF19B0; 210 | }; 211 | }; 212 | }; 213 | buildConfigurationList = 9356E2FF1879654700FF19B0 /* Build configuration list for PBXProject "ANBlurredImageViewDemo" */; 214 | compatibilityVersion = "Xcode 3.2"; 215 | developmentRegion = English; 216 | hasScannedForEncodings = 0; 217 | knownRegions = ( 218 | en, 219 | Base, 220 | ); 221 | mainGroup = 9356E2FB1879654700FF19B0; 222 | productRefGroup = 9356E3051879654700FF19B0 /* Products */; 223 | projectDirPath = ""; 224 | projectRoot = ""; 225 | targets = ( 226 | 9356E3031879654700FF19B0 /* ANBlurredImageViewDemo */, 227 | 9356E3241879654700FF19B0 /* ANBlurredImageViewDemoTests */, 228 | ); 229 | }; 230 | /* End PBXProject section */ 231 | 232 | /* Begin PBXResourcesBuildPhase section */ 233 | 9356E3021879654700FF19B0 /* Resources */ = { 234 | isa = PBXResourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | 9356E347187967B500FF19B0 /* nature.jpg in Resources */, 238 | 9356E3201879654700FF19B0 /* Images.xcassets in Resources */, 239 | 9356E3121879654700FF19B0 /* InfoPlist.strings in Resources */, 240 | 9356E31B1879654700FF19B0 /* Main.storyboard in Resources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | 9356E3231879654700FF19B0 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | /* End PBXResourcesBuildPhase section */ 252 | 253 | /* Begin PBXSourcesBuildPhase section */ 254 | 9356E3001879654700FF19B0 /* Sources */ = { 255 | isa = PBXSourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 938C8C20187BB4480040F120 /* ANBlurredImageView.m in Sources */, 259 | 9356E3141879654700FF19B0 /* main.m in Sources */, 260 | 9356E31E1879654700FF19B0 /* ANViewController.m in Sources */, 261 | 938C8C21187BB4480040F120 /* UIImage+BoxBlur.m in Sources */, 262 | 9356E3181879654700FF19B0 /* ANAppDelegate.m in Sources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | 9356E3211879654700FF19B0 /* Sources */ = { 267 | isa = PBXSourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | /* End PBXSourcesBuildPhase section */ 274 | 275 | /* Begin PBXTargetDependency section */ 276 | 9356E32B1879654700FF19B0 /* PBXTargetDependency */ = { 277 | isa = PBXTargetDependency; 278 | target = 9356E3031879654700FF19B0 /* ANBlurredImageViewDemo */; 279 | targetProxy = 9356E32A1879654700FF19B0 /* PBXContainerItemProxy */; 280 | }; 281 | /* End PBXTargetDependency section */ 282 | 283 | /* Begin PBXVariantGroup section */ 284 | 9356E3101879654700FF19B0 /* InfoPlist.strings */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | 9356E3111879654700FF19B0 /* en */, 288 | ); 289 | name = InfoPlist.strings; 290 | sourceTree = ""; 291 | }; 292 | 9356E3191879654700FF19B0 /* Main.storyboard */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 9356E31A1879654700FF19B0 /* Base */, 296 | ); 297 | name = Main.storyboard; 298 | sourceTree = ""; 299 | }; 300 | /* End PBXVariantGroup section */ 301 | 302 | /* Begin XCBuildConfiguration section */ 303 | 9356E3341879654700FF19B0 /* Debug */ = { 304 | isa = XCBuildConfiguration; 305 | buildSettings = { 306 | ALWAYS_SEARCH_USER_PATHS = NO; 307 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 320 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 321 | COPY_PHASE_STRIP = NO; 322 | GCC_C_LANGUAGE_STANDARD = gnu99; 323 | GCC_DYNAMIC_NO_PIC = NO; 324 | GCC_OPTIMIZATION_LEVEL = 0; 325 | GCC_PREPROCESSOR_DEFINITIONS = ( 326 | "DEBUG=1", 327 | "$(inherited)", 328 | ); 329 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 337 | ONLY_ACTIVE_ARCH = YES; 338 | SDKROOT = iphoneos; 339 | }; 340 | name = Debug; 341 | }; 342 | 9356E3351879654700FF19B0 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 347 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 348 | CLANG_CXX_LIBRARY = "libc++"; 349 | CLANG_ENABLE_MODULES = YES; 350 | CLANG_ENABLE_OBJC_ARC = YES; 351 | CLANG_WARN_BOOL_CONVERSION = YES; 352 | CLANG_WARN_CONSTANT_CONVERSION = YES; 353 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN_ENUM_CONVERSION = YES; 356 | CLANG_WARN_INT_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = YES; 361 | ENABLE_NS_ASSERTIONS = NO; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 364 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 365 | GCC_WARN_UNDECLARED_SELECTOR = YES; 366 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 367 | GCC_WARN_UNUSED_FUNCTION = YES; 368 | GCC_WARN_UNUSED_VARIABLE = YES; 369 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 370 | SDKROOT = iphoneos; 371 | VALIDATE_PRODUCT = YES; 372 | }; 373 | name = Release; 374 | }; 375 | 9356E3371879654700FF19B0 /* Debug */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 379 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 380 | CODE_SIGN_IDENTITY = "iPhone Developer"; 381 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 382 | GCC_PREFIX_HEADER = "ANBlurredImageViewDemo/ANBlurredImageViewDemo-Prefix.pch"; 383 | INFOPLIST_FILE = "ANBlurredImageViewDemo/ANBlurredImageViewDemo-Info.plist"; 384 | PRODUCT_NAME = "$(TARGET_NAME)"; 385 | WRAPPER_EXTENSION = app; 386 | }; 387 | name = Debug; 388 | }; 389 | 9356E3381879654700FF19B0 /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 394 | CODE_SIGN_IDENTITY = "iPhone Developer"; 395 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 396 | GCC_PREFIX_HEADER = "ANBlurredImageViewDemo/ANBlurredImageViewDemo-Prefix.pch"; 397 | INFOPLIST_FILE = "ANBlurredImageViewDemo/ANBlurredImageViewDemo-Info.plist"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | WRAPPER_EXTENSION = app; 400 | }; 401 | name = Release; 402 | }; 403 | 9356E33A1879654700FF19B0 /* Debug */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 407 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ANBlurredImageViewDemo.app/ANBlurredImageViewDemo"; 408 | FRAMEWORK_SEARCH_PATHS = ( 409 | "$(SDKROOT)/Developer/Library/Frameworks", 410 | "$(inherited)", 411 | "$(DEVELOPER_FRAMEWORKS_DIR)", 412 | ); 413 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 414 | GCC_PREFIX_HEADER = "ANBlurredImageViewDemo/ANBlurredImageViewDemo-Prefix.pch"; 415 | GCC_PREPROCESSOR_DEFINITIONS = ( 416 | "DEBUG=1", 417 | "$(inherited)", 418 | ); 419 | INFOPLIST_FILE = "ANBlurredImageViewDemoTests/ANBlurredImageViewDemoTests-Info.plist"; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | TEST_HOST = "$(BUNDLE_LOADER)"; 422 | WRAPPER_EXTENSION = xctest; 423 | }; 424 | name = Debug; 425 | }; 426 | 9356E33B1879654700FF19B0 /* Release */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 430 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ANBlurredImageViewDemo.app/ANBlurredImageViewDemo"; 431 | FRAMEWORK_SEARCH_PATHS = ( 432 | "$(SDKROOT)/Developer/Library/Frameworks", 433 | "$(inherited)", 434 | "$(DEVELOPER_FRAMEWORKS_DIR)", 435 | ); 436 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 437 | GCC_PREFIX_HEADER = "ANBlurredImageViewDemo/ANBlurredImageViewDemo-Prefix.pch"; 438 | INFOPLIST_FILE = "ANBlurredImageViewDemoTests/ANBlurredImageViewDemoTests-Info.plist"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | TEST_HOST = "$(BUNDLE_LOADER)"; 441 | WRAPPER_EXTENSION = xctest; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 9356E2FF1879654700FF19B0 /* Build configuration list for PBXProject "ANBlurredImageViewDemo" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 9356E3341879654700FF19B0 /* Debug */, 452 | 9356E3351879654700FF19B0 /* Release */, 453 | ); 454 | defaultConfigurationIsVisible = 0; 455 | defaultConfigurationName = Release; 456 | }; 457 | 9356E3361879654700FF19B0 /* Build configuration list for PBXNativeTarget "ANBlurredImageViewDemo" */ = { 458 | isa = XCConfigurationList; 459 | buildConfigurations = ( 460 | 9356E3371879654700FF19B0 /* Debug */, 461 | 9356E3381879654700FF19B0 /* Release */, 462 | ); 463 | defaultConfigurationIsVisible = 0; 464 | defaultConfigurationName = Release; 465 | }; 466 | 9356E3391879654700FF19B0 /* Build configuration list for PBXNativeTarget "ANBlurredImageViewDemoTests" */ = { 467 | isa = XCConfigurationList; 468 | buildConfigurations = ( 469 | 9356E33A1879654700FF19B0 /* Debug */, 470 | 9356E33B1879654700FF19B0 /* Release */, 471 | ); 472 | defaultConfigurationIsVisible = 0; 473 | defaultConfigurationName = Release; 474 | }; 475 | /* End XCConfigurationList section */ 476 | }; 477 | rootObject = 9356E2FC1879654700FF19B0 /* Project object */; 478 | } 479 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/ANAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ANAppDelegate.h 3 | // ANBlurredImageViewDemo 4 | // 5 | // Created by Aaron Ng on 1/5/14. 6 | // Copyright (c) 2014 Delve. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ANAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/ANAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ANAppDelegate.m 3 | // ANBlurredImageViewDemo 4 | // 5 | // Created by Aaron Ng on 1/5/14. 6 | // Copyright (c) 2014 Delve. All rights reserved. 7 | // 8 | 9 | #import "ANAppDelegate.h" 10 | 11 | @implementation ANAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/ANBlurredImageViewDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.delve.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/ANBlurredImageViewDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/ANViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ANViewController.h 3 | // ANBlurredImageViewDemo 4 | // 5 | // Created by Aaron Ng on 1/5/14. 6 | // Copyright (c) 2014 Delve. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ANBlurredImageView.h" 11 | @interface ANViewController : UIViewController 12 | @property (strong) IBOutlet ANBlurredImageView *imageView; 13 | 14 | // Blur without tint. 15 | @property (assign) IBOutlet UIButton *blurButton; 16 | 17 | // If tinted and blurButton is called, recalc frames. 18 | @property (assign) BOOL tinted; 19 | 20 | // Blur by playing the animation with a tint. 21 | @property (assign) IBOutlet UIButton *blurWithTintButton; 22 | 23 | // Unblur by playing the animation in reverse. 24 | @property (assign) IBOutlet UIButton *unblurButton; 25 | 26 | // Activity Indicator 27 | @property (assign) IBOutlet UIActivityIndicatorView *spinner; 28 | @end 29 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/ANViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ANViewController.m 3 | // ANBlurredImageViewDemo 4 | // 5 | // Created by Aaron Ng on 1/5/14. 6 | // Copyright (c) 2014 Delve. All rights reserved. 7 | // 8 | 9 | #import "ANViewController.h" 10 | 11 | @interface ANViewController () 12 | 13 | @end 14 | 15 | @implementation ANViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | 22 | // Fewer is better, default is 5 because this was intended for quick transitions. 20 is for demonstration purposes & a smoother animation. 23 | [_imageView setFramesCount:20]; 24 | 25 | // Best to set blurAmount and blurTint early on, since frames are precalculated. // If you need to change them, call generateBlurFramesWithCompletion but use sparingly because of performance issues. 26 | [_imageView setBlurAmount:1]; 27 | 28 | _tinted = NO; 29 | 30 | } 31 | 32 | - (void)didReceiveMemoryWarning 33 | { 34 | [super didReceiveMemoryWarning]; 35 | // Dispose of any resources that can be recreated. 36 | } 37 | 38 | -(IBAction)blur:(id)sender{ 39 | if (_tinted) 40 | { 41 | // Might take a while if we gotta recalculate frames. 42 | [NSThread detachNewThreadSelector:@selector(threadStartAnimating:) toTarget:self withObject:nil]; 43 | 44 | // Clear is the default blur color if none is set. We're resetting this because one gets set if blurWithTint is called. 45 | [_imageView setBlurTintColor:[UIColor clearColor]]; 46 | 47 | // Recalculate normal blur without tint. 48 | [_imageView generateBlurFramesWithCompletion:^{ 49 | dispatch_async(dispatch_get_main_queue(), ^{ 50 | [_spinner stopAnimating]; 51 | }); 52 | // Blur with duration, also has a version w/ a callback. 53 | [_imageView blurInAnimationWithDuration:0.25f]; 54 | }]; 55 | } 56 | else{ 57 | [_imageView blurInAnimationWithDuration:0.25f]; 58 | } 59 | _tinted = NO; 60 | 61 | } 62 | 63 | - (void) threadStartAnimating:(id)data { 64 | // Just here for demonstration, really. In case you set the framesCount really high, it might be good to present a spinner. 65 | [_spinner startAnimating]; 66 | } 67 | 68 | 69 | -(IBAction)blurWithTint:(id)sender{ 70 | 71 | if (!_tinted){ 72 | // Might take a while if we gotta recalculate frames. 73 | [NSThread detachNewThreadSelector:@selector(threadStartAnimating:) toTarget:self withObject:nil]; 74 | 75 | // Arbitrary blur color. Fades in alpha from 0 to selected alpha. 76 | [_imageView setBlurTintColor:[UIColor colorWithWhite:0.11f alpha:0.5]]; 77 | 78 | // Recalculate frames, or risk them not showing. 79 | // Call sparingly, best if everything is set before in viewDidLoad or earlier to prevent recalculation. 80 | [_imageView generateBlurFramesWithCompletion:^{ 81 | 82 | dispatch_async(dispatch_get_main_queue(), ^{ 83 | [_spinner stopAnimating]; 84 | }); 85 | [_imageView blurInAnimationWithDuration:0.25f]; 86 | 87 | }]; 88 | } 89 | else{ 90 | [_imageView blurInAnimationWithDuration:0.25f]; 91 | } 92 | // If user presses non-tint blur, know to re-calculate frames without tint. 93 | _tinted = YES; 94 | 95 | } 96 | 97 | -(IBAction)unBlur:(id)sender{ 98 | // Reversed blur animation. 99 | [_imageView blurOutAnimationWithDuration:0.5f]; 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 33 | 43 | 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ANBlurredImageViewDemo 4 | // 5 | // Created by Aaron Ng on 1/5/14. 6 | // Copyright (c) 2014 Delve. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ANAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([ANAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ANBlurredImageViewDemo/nature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronn/ANBlurredImageView/2ca9bb30de5fccc544d1d0d6fd2cef9015203823/ANBlurredImageViewDemo/nature.jpg -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Aaron Ng and contributors 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # ANBlurredImageView 2 | Subclass of UIImageView for animating the blurring and unblurring of images with a tint color. Useful for quick transitions and bringing focus to the foreground. 3 | 4 | ![Blurred View](http://cl.ly/image/1m0O382f3g1F/blur-3.gif) 5 | 6 | ## Installation 7 | Drag the following files into your project. Made to work with iOS7+. 8 | 9 | ANBlurredImageView.h 10 | ANBlurredImageView.m 11 | UIImage+BoxBlur.h 12 | UIImage+BoxBlur.m 13 | 14 | ## Usage 15 | This was made for fast transitions and builds on top of UIImageView's startAnimation and stopAnimation. 16 | 17 | Default values are as follows: 18 | 19 | frameCount = 5; // Number of frames, 20 | blurTintColor = [UIColor clearColor]; // If an alpha is specified, starts at 0 alpha and works its way up to the alpha value with each frame. 21 | blurAmount = 0.1f; // Takes between 0 and 1. 22 | 23 | Blur your image by calling any of the following on your imageView: 24 | 25 | -(void)blurInAnimationWithDuration:(CGFloat)duration; 26 | -(void)blurOutAnimationWithDuration:(CGFloat)duration; 27 | -(void)blurInAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion; 28 | -(void)blurOutAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion; 29 | 30 | Set all your values as early as possible, ideally in the superview's viewDidload. **Since we're calculating frames, any change to the frameCount, blurTintColor, blurAmount or the image after the view has loaded requires that you call the following method to ensure your changes are processed.** 31 | 32 | -(void)generateBlurFramesWithCompletion:(void(^)())completion; 33 | 34 | 35 | 36 | ## Demo 37 | Demo shows normal blurring, tinted blurring and unblurring. The demo uses more frames than you might need, so switching between normal blur and tinted blurring takes some time to recalculate the frames based on image size and frame count. 38 | 39 | ## Credits 40 | The image box blur algorithm is from [IndieAmbitions Blog](http://indieambitions.com/idevblogaday/perform-blur-vimage-accelerate-framework-tutorial/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+IndieAmbitions+%28Indie+Ambitions%29). UIImage category is modified from [ios-relatimeblur](https://github.com/alexdrone/ios-realtimeblur). 41 | 42 | **Follow me on Twitter at [@aaronykng](http://www.twitter.com/aaronykng).** 43 | 44 | ## License 45 | Do whatever you'd like. I'd appreciate a link back and a mention if you use it though! --------------------------------------------------------------------------------