MGAlertUtility 0.1.1

MGAlertUtility 0.1.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2017年1月

Matthew Gardner 维护。



  • Matthew Gardner

这是一个简单的实用类,包含用于显示 UIAlertController 的静态方法。

示例

OK Alert

[MGAlertUtility showOkAlertWithMessage:@"Check the provided email for further instructions."
                                 title:@"Account created"
                              okAction:^(UIAlertController *alert, UIAlertAction *action) {
                                NSLog(@"User pressed %@", action.title);
                              }];

YesNo Alert

[MGAlertUtility showYesNoAlertWithMessage:@"What is this"
                                    title:@"idk"
                                   onView:self
                                 okAction:^(UIAlertController *alert, UIAlertAction *action) {
                                   NSLog(@"some action '%@'", action.title);
                                 }];

Action Sheet Alert

[MGAlertUtility showCancelActionSheet:@"Hello"
                              message:@"How are you?"
                              actions:@{
                                        @"Action 1" : ^(UIAlertController *alert, UIAlertAction *action) {
                                          NSLog(@"First Action: %@", action.title);
                                        }, 
                                        @"Action 2" : ^(UIAlertController *alert, UIAlertAction *action) {
                                          NSLog(@"Second Action: %@", action.title);
                                        }
                              }];