[英]MFMailComposeViewController: how to get notified when view appears?
In my app, users can take a picture with the camera or pick one from the library and email it as an attachment. 在我的应用程序中,用户可以使用相机拍摄照片或从图库中选择一张并通过电子邮件将其作为附件发送。 I use the
MFMailComposeViewController
for seamless email. 我将
MFMailComposeViewController
用于无缝电子邮件。 On my iPhone 3GS, it takes about 5-7 seconds for the email view to appear with the attachment. 在我的iPhone 3GS上,与附件一起显示的电子邮件视图大约需要5-7秒。
Now I want to show a progress indicator view when the user pushes the "Send" button and hide that view when the email view comes up. 现在,我想在用户按下“发送”按钮时显示进度指示器视图,并在出现电子邮件视图时隐藏该视图。 The problem is that the
MFMailComposeViewController
delegate only calls when the email sending is done . 问题是
MFMailComposeViewController
委托仅在电子邮件发送完成后才调用 。
Can I get notified somehow when the email window appears on the screen? 当电子邮件窗口出现在屏幕上时,我能以某种方式得到通知吗?
Edit: I just thought about it... Can't you just add the progress indicator in your view and the composer view will just get on top of it? 编辑:我只是考虑过...您不能只在视图中添加进度指示器,而作曲者视图将位于它之上吗? This way you could easily remove the indicator when the
MFMailComposerViewController
delegate calls its methods. 这样,当
MFMailComposerViewController
委托调用其方法时,您可以轻松删除该指示器。
I don't see any simple way to get notified. 我没有收到通知的任何简单方法。 What about writing a category for this?
为此写一个类别呢?
@interface MFMailComposeViewController (MyAddition)
@end
@implementation MFMailComposeViewController (MyAddition)
- (void)viewDidAppear:(BOOL)animated {
[self.mailComposeDelegate mailComposerDidAppear];
[super viewDidAppear:animated];
}
@end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.