rushisangani / RSAlertController

A beautiful customizable AlertView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RSAlertController

A beautiful customizable AlertViewController with dyanmic buttons. RSAlertController can be used to show Alert with one, two, three buttons from any ViewController.

Alt text Alt text

Features

  • Show AlertView as a ViewController.
  • Customizable Title, message and buttons color.
  • Automatic buttons layout for more than two buttons.
  • Automatic dismiss on Tap outside.
  • Get button's click event inside block.

How To Use

Show Simple Alert

[[RSAlertViewController sharedInstance] showAlertWithTitle:@"Alert" message:@"Do you want to confirm?" buttons:@[@"Cancel", @"OK"] fromViewController:self withActionHandler:^(NSUInteger buttonIndex) {

    NSLog(@"button clicked at Index %lu", buttonIndex);
}];

Show Custom Alert

RSAlertViewController *alertView = [[RSAlertViewController sharedInstance] showAlertWithTitle:@"Success" message:@"Do you want to proceed?\n\nAnswer by selecting one of the three option." buttons:@[@"No", @"Yes", @"Never"] fromViewController:self withActionHandler:^(NSUInteger buttonIndex) {

    NSLog(@"button clicked at Index %lu", buttonIndex);

}];

alertView.dismissOnTapOutside = YES;
alertView.textAlignment = NSTextAlignmentLeft;

License

RSAlertViewController is released under the MIT license. See LICENSE for details.

About

A beautiful customizable AlertView.

License:MIT License


Languages

Language:Objective-C 100.0%