小编use*_*365的帖子

如何在Swift UIAlertView中显示警报不起作用

我想显示一个警报,但UIAlertView不能在swift中工作.我怎样才能做到这一点?这是我在objective-c中的方式,但是当我尝试将其转换为swift代码时,它不起作用.

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message" 
                                              message:@"Message"
                                             delegate:nil
                                    cancelButtonTitle:@"OK" 
                                    otherButtonTitles:nil];


[alert show];
Run Code Online (Sandbox Code Playgroud)

alert swift

0
推荐指数
1
解决办法
7062
查看次数

标签 统计

alert ×1

swift ×1