I am trying to execute an action with alert in my cell, but nothing happens
@IBAction func btneliminar(sender: AnyObject) {
let alert = UIAlertController(title: "Eliminar", message: "Esta a punto de eliminar una cancion", preferredStyle: .Alert)
let action = UIAlertAction(title: "Si", style: .Default, handler: {(action) in
let cancion: Cancion = DataBaseManager.sharedInstance.getSongByKey( "id", value: Int(self.lblid.text!)!)
DataBaseManager.sharedInstance.deletesong(cancion)
DataBaseManager.sharedInstance.saveSongsDatBaseChanges(
self.navigationController?.popViewControllerAnimated(true)
})
alert.addAction(action)
alert.addAction(UIAlertAction(title: "No", style: .Cancel, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
}
When I do not place the alert if I complete the action, but when I am alerting, the button does not work