如何在 TableViewCell
中使用 UIAlertController?
给我一个错误does not have a member called "presentViewController"
。
我的 TableViewController
被命名为“OrdensCompraTableViewController”
我的函数:
@IBAction func telefonarCliente(sender: AnyObject) {
var alert = UIAlertController(title: "Fotos em falta!", message: "Tem de introduzir 6 fotos.", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
if let phoneCallURL:NSURL = NSURL(string: "tel://") {
let application:UIApplication = UIApplication.sharedApplication()
if (application.canOpenURL(phoneCallURL)) {
application.openURL(phoneCallURL);
}
}
}
最佳答案
使用 telprompt://123456789
而不是创建 UIAlertController
在调用电话号码之前提示用户。
关于ios - 如何在 UITableViewCell 中使用 UIAlertController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32235616/