You are trying to call presentViewController in a UITableViewCell , but instead this method is a member of the UIViewController .
Here is my suggestion:
1) Create the protocol CustomCellDeerCallsDelegate , i.e. ..:
protocol CustomCellDeerCallsDelegate { func showAlert(title:String, message:String); }
2) Add a weak property to the custom cell:
var delegate:CustomCellDeerCallsDelegate?
3) In your clickDetialsInfoButton function, the method for the delegate is called:
self.delegate?.showAlert("DDDDD", message: arrayOfDetialsInfoDeerCalls[sender.tag])
4) Add a protocol implementation to the ViewController that hosts the table view that displays the cell.
5) In the protocol implementation of the showAlert function, show a warning:
func showAlert(title:String, message:String){ var alert = UIAlertController(title: "dddddd", message: arrayOfDetialsInfoDeerCalls[sender.tag], preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) self.presentViewController(alert, animated: true, completion: nil) }
Jakub source share