Created
December 12, 2018 05:07
-
-
Save leoiphonedev/272de997e5050304fda8b8ff69a58e7e to your computer and use it in GitHub Desktop.
Code for presenting mail composer (desfualt) when user tap on send mail button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func sendEmail(_ sender: Any) { | |
if MFMailComposeViewController.canSendMail() { | |
let mailComposer = MFMailComposeViewController() | |
mailComposer.setSubject("Update about ios tutorials") | |
mailComposer.setMessageBody("What is the update about ios tutorials on youtube", isHTML: false) | |
mailComposer.setToRecipients(["[email protected]"]) | |
self.present(mailComposer, animated: true | |
, completion: nil) | |
} else { | |
print("Email is not configured in settings app or we are not able to send an email") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment