我想显示一个警报,但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)