Home

Awesome

AGBlurTransition

Custom transition delegate for presenting modal views with a blur background in a frame usin the new iOS7 custom transitions API.

Why use AGBlurTransition?

There are many implementations of view controllers and blur effects. However, they all require changing the code to adapt to their API for presenting/dismissing. With this library, your code will stay using regular modal view controller methods for preseting/dismissing, all you need to do is indicate the transition delegate before presenting it.

Installation

Copy the files in src folder or install it with CocoaPods

pod 'AGBlurTransition'

Use

In any view controller that wants to presents a modal with blur background, import the library:

#import "UIViewController+AGBlurTransition.h"

And set the transitioningDelegate and modalPresentationStyle. Example:

    AGModalViewController *vc = [[AGModalViewController alloc] init];
    self.modalPresentationStyle = UIModalPresentationCustom;
    vc.transitioningDelegate = self.AG_blurTransitionDelegate;
    [self presentViewController:vc animated:YES completion:nil];

You can also customize the main styling attributes using the properties declared in the AGBlurTransitionDelegate class. Example:

    self.AG_blurTransitionDelegate.tintColor = [UIColor colorWithWhite:1 alpha:0.5];

Caveats

License

Made available under the MIT License.

Collaboration

Forks, patches and other feedback are always welcome.

Thanks for your pull requests to:

Credits

AGBlurTransition is brought to you by Angel Garcia Olloqui. You can contact me on:

Project Page: AGBlurTransition

Personal webpage: angelolloqui.com

Twitter: @angelolloqui

LinkedIn: angelolloqui