TWAlertView 0.1.4

TWAlertView 0.1.4

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2016年6月

Tulakshana 维护。



  • 作者
  • tulakshana

这个库受到UIAlertController的启发。TWAlertView将自动识别最顶层的视图控制器来显示警告,从而使显示简单的警告变得轻松简单。

使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
    [TWAlertView showAlert:@"Hello" message:@"What do you like to do today?" buttonsArray:[NSArray arrayWithObjects:@"Socialise",@"Code", nil] callback:^(NSError *error, int buttonIndex) {
        if (error) {
            NSLog(@"%@",error.debugDescription);
        }else{
            switch (buttonIndex) {
            case 0:
                [self socialise];
                break;
            case 1:
                [self code];
                break;
            default:
                break;
            }
        }
    }];


    return YES;
}

- (void)socialise{
    [TWAlertView showAlert:@"Warning!" message:@"Are you sure you want to compromise your valuable time?"];
}

- (void)code{
    [TWAlertView showAlert:@"Nice!" message:@"Good choice buddy"];
}

安装

TWAlertView可通过CocoaPods获取。要安装,只需将以下行添加到您的Podfile文件中:

pod 'TWAlertView', '0.1.3'

许可证

TWAlertView遵循MIT许可证。更多信息请参阅LICENSE文件。

待办事项

  • 支持动作表样式