Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Temporary and unobtrusive translucent alert view for iOS
Objective-C Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
OLGhostAlertView.h
OLGhostAlertView.m
README.md

README.md

OLGhostAlertView

Temporary and unobtrusive translucent alert view for iPhone and iPad. It looks like this.

Details

OLGhostAlertView allows you to present a translucent view with a title and an optional message on the bottom of the screen. Use it to inform your user about temporary issues that do not require any immediate action and are not blocking the flow of your app.

OLGhostAlertView can have a title and an optional message, in a way similar to UIAlertView. It automatically fades out after a configurable time interval and, by default, can be dismissed with a tap. It can automatically adapt its size according to the device it's being deployed on, user interface orientation and length of the strings passed to it.

Usage

First, copy the files into your project. Then, import the header file like so:

#import "OLGhostAlertView.h"

After that, here's how you present an OLGhostAlertView:

OLGhostAlertView.h *ghastly = [[OLGhostAlertView alloc] initWithTitle:@"I am the walrus." message: @"Sitting on a cornflake, waiting for the van to come."];
[ghastly show];

There are three convenience methods to init OLGhostAlertView:

initWithTitle:message:timeout:dismissible:

Exposes all of the available options.

- (id)initWithTitle:(NSString *)title message:(NSString *)message timeout:(NSTimeInterval)timeout dismissible:(BOOL)dismissible;

Parameters

title
    The string that appears in the view's title label. It is set in a bold, 17pt font.

message
    Descriptive text that provides more details than the title. Set in a regular, 15pt font. Can be nil.

timeout
    Amount of seconds before the view is automatically dismissed.

dismissible
    Whether the view can be dismissed with a tap or not.

initWithTitle:message:

It's equivalent to initWithTitle:message:timeout:dismissible:, but assumes default values for timeout (6 seconds) and dismissible (YES).

- (id)initWithTitle:(NSString *)title message:(NSString *)message;

initWithTitle:

It's equivalent to initWithTitle:message:timeout:dismissible:, but assumes default values for message (nil) timeout (4 seconds) and dismissible (YES).

- (id)initWithTitle:(NSString *)message;

You're welcome, lazy people.

License

Do whatever you want with this. If you like it, great! Let us know on Twitter.

Help us make this better

We built OLGhostAlertView because we needed it for one of our projects. It's definitely not perfect (hell, it was built by a designer) and it doesn't do everything it could. If you improve it in any way, please send us a pull request. Enjoy!

Something went wrong with that request. Please try again.