Git Product home page Git Product logo

asdepthmodal's Introduction

ASDepthModal

ASDepthModal is mostly inspired by a nice CSS work from http://lab.hakim.se/avgrund/.

It gives a sense of depth between the current fullscreen view which is sent backward with a blur effect and a modal popup view which appears in front.

Works on iOS 5 and 6.

The blur effect is a code borrowed from https://github.com/rnystrom/RNBlurModalView.

Try it

Download the whole project and run it under Xcode. You can choose either iPhone or iPad destination. It supports all orientations change.

Use it

Just copy ASDepthModalViewController.h, ASDepthModalViewController.m, UIImage+Blur.h and UIImage+Blur.m in your project and #import "ASDepthModalViewController.h" where you need it.

You can also add pod 'ASDepthModal' to your Podfile.

Show

Once you have your popup view, here is how you would present it

[ASDepthModalViewController presentView:yourPopupView];

Hide

The popup view is automatically closed as soon as you tap outside of it.

If you need to close the popup view by code (you usually have a "close" button for this purpose)

[ASDepthModalViewController dismiss];

Configure

You can configure the background color as well and different kind of options:

  • the effect applied on the popup when it appears ans disappears
  • whether the underlay view is blurred
  • whether a tap outside of the popup closes it. You can also add some code to execute once the popup is closed.
[ASDepthModalViewController presentView:yourPopupView
                        backgroundColor:color
                                options:options
                      completionHandler:handler];

Three styles are available : no effect, grow effect or shrink effect.

ARC Support

This class requires ARC.

Dependencies

QuartzCore and Accelerate frameworks are needed.

asdepthmodal's People

Contributors

3lvis avatar alexasfb avatar autresphere avatar shadyelyaski avatar

Watchers

 avatar  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.