An Objective-C class that adds a sense of depth to your modal popup views.
Latest commit 07b4e45 May 20, 2014 @autresphere Merge branch 'master' of
…into alexasfb-patch-1
Failed to load latest commit information.
ASDepthModal Fix memory leak #22 May 20, 2014
Example Refactoring, simplification & doc. Apr 22, 2013
Screenshots Updated video with blur effect and orientation change. Apr 5, 2013
.gitignore Cleaning Nov 21, 2012 pod integration. Jul 29, 2013


ASDepthModal is mostly inspired by a nice CSS work from

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

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.


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

[ASDepthModalViewController presentView:yourPopupView];


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];


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

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

ARC Support

This class requires ARC.


QuartzCore and Accelerate frameworks are needed.