Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何以编程方式打开电子邮件配置表?_Ios_Objective C_Iphone_Swift - Fatal编程技术网

Ios 如何以编程方式打开电子邮件配置表?

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

我可以检查iPhone上是否配置了电子邮件客户端:

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];