This is super frustrating because i've looked at code examples from very recent answers, tutorials, etc. on how to create a send email function (using the built in ios mail) and it's throwing me errors. Specifically, unresolved use of "self identifier" and "present"
func sendEmail(sender: AnyObject) {
let mailVC = MFMailComposeViewController()
mailVC.mailComposeDelegate = self
mailVC.setToRecipients([])
mailVC.setSubject("Subject for email")
mailVC.setMessageBody("Email message string", isHTML: false)
presentViewController(mailVC, animated: true, completion: nil)
}
what example am i doing wrong? Logically, it makes sense; i've created an instance of mailcompose and then assigned its delegate to itself.
looked at these two for use: https://www.hackingwithswift.com/example-code/uikit/how-to-send-an-email Sending an email from swift 3