We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#if os(iOS) import Foundation import UIKit /** * - Fixme: ⚠️️ Add for macOS as well? or is it supported as is? */ public class Emailer { // public typealias MailInitiator = UIViewController & MFMailComposeViewController /** * - Fixme: ⚠️️ Add example * - Parameters: * - viewController: the mail vc * - text: text to mail * - recipient: "[email protected]" */ public static func sendMail(on viewController: UIViewController/*MFMailComposeViewController*/, text: String, recipient: String) -> UIAlertAction { fatalError("Out of order") // - Fixme: ⚠️️ requires testing // UIAlertAction(title: "Send Email", style: .default) { // (_: UIAlertAction) in // DispatchQueue.main.async { // if MFMailComposeViewController.canSendMail() { // let composeVC = MFMailComposeViewController() // composeVC.mailComposeDelegate = viewController // composeVC.setToRecipients([recipient]) // composeVC.setSubject("Console Log") // composeVC.setMessageBody(text, isHTML: false) // viewController.present(composeVC, animated: true, completion: nil) // } else { // let alert = UIAlertController(title: "Email account required", // message: "Please configure an email account in Mail", // preferredStyle: .alert) // alert.addAction(UIAlertAction.init(title: "OK", style: .default)) // viewController.present(alert, animated: true, completion: nil) // } // } // } } } #endif
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: