MFMailComposer toReceiptsText 延迟

MFMailComposer toReceiptsText with delay

我正在使用 MFMailcomposeViewController 来实现邮件功能。 但是当应用程序出现 MFMailComposeViewController 时,toReceipts 中的文本显示为 delay.why 是这样吗?

if MFMailComposeViewController.canSendMail()
  {
    var mailPicker = MFMailComposeViewController()
    mailPicker.mailComposeDelegate = self;
    mailPicker.setSubject("hello");
    mailPicker.setMessageBody(txtViewBody.text, isHTML: false);
    mailPicker.setToRecipients(["aashish01cs@gmail.com"])

    self.becomeFirstResponder();


    presentViewController(mailPicker, animated: true, completion: {
        println("Mail composer completion block")
    });

    }

它会在模拟器中延迟显示收件人。
在设备中它不会延迟加载。

我知道防止 MFMailComposeViewController 跳动呈现的唯一方法是使用私人 api 调用,但应用程序将被拒绝...

    MFMailComposeViewController *mailComposeVC = [[MFMailComposeViewController alloc] init];
    // do your setup here

    UIViewController *internalComposeVC = (UIViewController *) [mailComposeVC.viewControllers firstObject];
    // call private method to layout the view immediately
    SEL privateSelector = NSSelectorFromString(@"_endDelayingCompositionPresentation");
    if ([internalComposeVC respondsToSelector:privateSelector]) {
        ((void (*)(id, SEL))[internalComposeVC methodForSelector:privateSelector])(internalComposeVC, privateSelector);
    }

    // present the MFMailComposeViewController
    [self presentViewController:mailComposeVC animated:TRUE completion:nil];

    // while presenting force the controller to set the recipient immediately
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [internalComposeVC viewWillAppear:FALSE];
        [internalComposeVC viewDidAppear:FALSE];
    });

我只用 iOS 8

测试过