I use this block to send message to the contacts, after sending, the back button is there, but when I touch it nothing happens. Please help me out :)
-(IBAct
Here's the answer for Swift 4, iOS 11
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
print("Emailing attempt, error="+(error?.localizedDescription)!)
switch (result){
case MFMailComposeResult.cancelled:
print("Mail cancelled");
break;
case MFMailComposeResult.saved:
print("Mail saved");
break;
case MFMailComposeResult.sent:
print("Mail sent");
break;
case MFMailComposeResult.failed:
print("Mail sent failure: %@", error?.localizedDescription);
break;
default:
break;
}
// Close the Mail Interface
controller.dismiss(animated: true)
}