EmailHelper

class EmailHelper : NSObject, MFMailComposeViewControllerDelegate

An email helper class which allows us to send emails in the support section of the settings view.

  • The EmailHelper static object.

    Declaration

    Swift

    public static let shared: EmailHelper
  • Send an email by using the built in email app in iOS.

    Should show a pop-up in the future if the default mail has not been set.

    Declaration

    Swift

    func sendEmail(subject: String, body: String, to: String) -> Bool

    Parameters

    subject

    The subject field for the email.

    body

    The text in the body of the email.

    to

    The receiving email address.

    Return Value

    A boolean confirming that a default email has been set up.

  • Undocumented

    Declaration

    Swift

    func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?)
  • Undocumented

    Declaration

    Swift

    static func getRootViewController() -> UIViewController?