alexanderjarvis / PXAlertView

A drop-in replacement for UIAlertView that is more customisable and skinnable
MIT License
592 stars 95 forks source link

PXAlertView

PXAlertView is a UIAlertView replacement similar to the style in iOS 7 but with a block based API and the ability to customise the styling and add custom views.

Preview

Demo Animation

Features

Installation

Add the following to your CocoaPods Podfile

pod 'PXAlertView', '~> 0.1.0'

or clone as a git submodule,

or just copy PXAlertView.h and .m into your project.

Usage

See PXAlertView.h for the complete API.

An Example

[PXAlertView showAlertWithTitle:@"The Matrix"
                        message:@"Pick the Red pill, or the blue pill"
                    cancelTitle:@"Blue"
                     otherTitle:@"Red"
                     completion:^(BOOL cancelled, NSInteger buttonIndex) {
                         if (cancelled) {
                             NSLog(@"Cancel (Blue) button pressed");
                         } else {
                             NSLog(@"Other (Red) button pressed");
                         }
                     }];

TODO

License

PXAlertView is available under the MIT license. See the LICENSE file for more info.