Ios 如何以编程方式打开电子邮件配置表?
我可以检查iPhone上是否配置了电子邮件客户端:Ios 如何以编程方式打开电子邮件配置表?,ios,objective-c,iphone,swift,Ios,Objective C,Iphone,Swift,我可以检查iPhone上是否配置了电子邮件客户端: if ([MFMailComposeViewController canSendMail]) { // Actions to send mail } else { //Actions to show an error message by UIAlertView } 如果没有配置电子邮件帐户,如何将用户重定向到电子邮件帐户配置表?您可以打开首选项应用程序,但不能打开更多。从iOS8开始,只需使用以下命令: NSURL *set
if ([MFMailComposeViewController canSendMail])
{
// Actions to send mail
}
else
{
//Actions to show an error message by UIAlertView
}
如果没有配置电子邮件帐户,如何将用户重定向到电子邮件帐户配置表?您可以打开首选项应用程序,但不能打开更多。从iOS8开始,只需使用以下命令:
NSURL *settingsAppURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:settingsAppURL];