How can I use an UIAlertController inside a TableViewCell
?
Gives me an error does not have a member called "presentViewController"
.
My TableViewController
is named "OrdensCompraTableViewController"
My function:
@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);
}
}
}