ios 从SKScene中解除MFMailComposeViewController

jhiyze9q  于 2023-04-13  发布在  iOS
关注(0)|答案(1)|浏览(105)

SKScene打开MFMailComposeViewController的方法如下:

-(void)sendmail {

if ([MFMailComposeViewController canSendMail]) {

    MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
    mailer.delegate = self;
    NSArray *recipients = [NSArray arrayWithObjects:@"nothing@gmail.com", nil];
    [mailer setToRecipients:recipients];

    UIViewController *vc = self.view.window.rootViewController;
    [vc presentViewController:mailer animated:YES completion:nil];
 }
}

这是可行的,但是当我想返回到SKScene时,委托方法没有被调用,无法返回。
这是SKScene的.h:

@interface SettingScene : SKScene <UINavigationControllerDelegate, MFMailComposeViewControllerDelegate>

怎么了?
谢谢

v8wbuo2f

v8wbuo2f1#

开始吧,

mailer.mailComposeDelegate = self;

同时呈现邮件。

相关问题