GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aaronn/ANBlurredImageView: Animated blur-in and blur-out on UIImageView.

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
ANBlurredImageView
ANBlurredImageView
 
 
ANBlurredImageViewDemo.xcodeproj
ANBlurredImageViewDemo.xcodeproj
 
 
ANBlurredImageViewDemo
ANBlurredImageViewDemo
 
 
.gitignore
.gitignore
 
 
ANBlurredImageView.podspec
ANBlurredImageView.podspec
 
 
LICENSE
LICENSE
 
 
Readme.md
Readme.md
 
 

Repository files navigation

ANBlurredImageView

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.

Blurred View

Installation

Drag the following files into your project. Made to work with iOS7+.

ANBlurredImageView.h
ANBlurredImageView.m
UIImage+BoxBlur.h
UIImage+BoxBlur.m

Usage

This was made for fast transitions and builds on top of UIImageView's startAnimation and stopAnimation.

Default values are as follows:

frameCount = 5; // Number of frames, 
blurTintColor =  [UIColor clearColor]; // If an alpha is specified, starts at 0 alpha and works its way up to the alpha value with each frame.
blurAmount = 0.1f; // Takes between 0 and 1.

Blur your image by calling any of the following on your imageView:

-(void)blurInAnimationWithDuration:(CGFloat)duration;
-(void)blurOutAnimationWithDuration:(CGFloat)duration;
-(void)blurInAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion;
-(void)blurOutAnimationWithDuration:(CGFloat)duration completion:(void(^)())completion;

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.

-(void)generateBlurFramesWithCompletion:(void(^)())completion;

Demo

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.

Credits

The image box blur algorithm is from IndieAmbitions Blog. UIImage category is modified from ios-relatimeblur.

Follow me on Twitter at @aaronykng.

License

Do whatever you'd like. I'd appreciate a link back and a mention if you use it though!

About

Animated blur-in and blur-out on UIImageView.

Resources

Readme
BSD-2-Clause license
Activity

Stars

790 stars

Watchers

20 watching

Forks

54 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.