Skip to content

Latest commit

 

History

History
118 lines (91 loc) · 3.13 KB

README.md

File metadata and controls

118 lines (91 loc) · 3.13 KB

DSDAlertManager

Version License Platform

DSDAlertManager is intended to simplify the dialog display in iOS.

Requirements

  • iOS 8.0+

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

DSDAlertManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DSDAlertManager"

Usage

OK button only

[DSDAlertManager showAlert:self
                     title:@"title"
                   message:@"message"
                        ok:^{
                            NSLog(@"OK tap!");
                        }];

OK button only (Customize button label)

[DSDAlertManager showAlert:self
                     title:@"title"
                   message:@"message"
                   okLabel:@"CustomOK"
                        ok:^{
                            NSLog(@"OK tap!");
                        }];

OK and Cancel buttons

[DSDAlertManager showAlert:self
                     title:@"title"
                   message:@"message"
                        ok:^{
                            NSLog(@"OK tap!");
                        }
                    cancel:^{
                        NSLog(@"Cancel tap!");
                    }];

YES and NO buttons

[DSDAlertManager showAlert:self
                     title:@"title"
                   message:@"message"
                       yes:^{
                           NSLog(@"YES tap!");
                       }
                        no:^{
                            NSLog(@"NO tap!");
                        }];

YES and NO buttons (Customize button label)

[DSDAlertManager showAlert:self
                     title:@"title"
                   message:@"message"
                  yesLabel:@"CustomYES"
                       yes:^{
                           NSLog(@"YES tap!");
                       }
                   noLabel:@"CustomNO"
                        no:^{
                            NSLog(@"NO tap!");
                        }];

Possible value input

[DSDAlertManager showEditAlert:self
                         title:@"title"
                       message:@"message"
                         value:_dataSources[4].value
                            ok:^(NSString *value) {
                                NSLog(@"OK(%@) tap!", value);
                            }
                        cancel:^{
                            NSLog(@"Cancel tap!");
                        }];

Author

dsdsk

License

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