iOS Swift: Open Mail app in inbox emails

前端 未结 1 1308
借酒劲吻你
借酒劲吻你 2021-02-20 07:59

Evening, I\'m trying to open the inbox mail of the Mail app from a button action...

In the web I saw that is possibile to open the email app the the EmailComposer object

1条回答
  •  醉酒成梦
    2021-02-20 08:05

    I resolved using the following code:

       let mailURL = URL(string: "message://")!
       if UIApplication.shared.canOpenURL(mailURL) {
           UIApplication.shared.open(mailURL, options: [:], completionHandler: nil)
        }
    

    0 讨论(0)
提交回复
热议问题