GithubHelp home page GithubHelp logo

isabella232 / agblurtransition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prolificinteractive/agblurtransition

0.0 0.0 0.0 145 KB

Work in progress of a custom transition delegate for presenting modal views with a blur background

License: MIT License

Objective-C 100.00%

agblurtransition's Introduction

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

  • iOS7: The component makes use of the iOS7 custom transitions API. Hence, only iOS7 and later are supported.

  • Fixed size: The transition delegate does not observe changes on the size of the view, so rotations or other view manipulations are not supported.

  • Static background: The glass background is composed by bluring a screenshot of the parent view in the moment of presenting the modal. Changes in the parent view will not be reflected on the blurred background.

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

agblurtransition's People

Contributors

angelolloqui avatar maxmamis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.