Sending an email from swift 3

前端 未结 5 2058
广开言路
广开言路 2020-12-25 09:39

I am trying to set up an app with send email option.

I have this code:

import Foundation
import MessageUI
import UIKit

class emailClass: UIViewContr         


        
5条回答
  •  再見小時候
    2020-12-25 10:19

    The problem with your code is, that the

    // Present the view controller modally. self.present(composeVC, animated: true, completion: nil)

    presents itself in itself ;-)

    If you don´t know the current view controller, just display it on the RootViewController, i.e.

    UIApplication.shared.keyWindow?.rootViewController?.present(...

提交回复
热议问题