Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/autresphere/ASDepthModal
An Objective-C class that adds a sense of depth to your modal popup views.
https://github.com/autresphere/ASDepthModal
Last synced: 2 months ago
JSON representation
An Objective-C class that adds a sense of depth to your modal popup views.
- Host: GitHub
- URL: https://github.com/autresphere/ASDepthModal
- Owner: autresphere
- License: mit
- Created: 2012-10-04T10:38:04.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-20T06:26:42.000Z (over 10 years ago)
- Last Synced: 2024-04-25T21:01:18.054Z (9 months ago)
- Language: Objective-C
- Homepage:
- Size: 1.9 MB
- Stars: 431
- Watchers: 35
- Forks: 74
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
- awesome - ASDepthModal - An Objective-C class that adds a sense of depth to your modal popup views. (etc)
- awesome - ASDepthModal - An Objective-C class that adds a sense of depth to your modal popup views. (etc)
README
## 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.
![](https://github.com/autresphere/ASDepthModal/raw/master/Screenshots/iPhoneVideo.gif)
## 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
``` objective-c
[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)
``` objective-c
[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.``` objective-c
[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.