mfmailcomposeviewcontroller

ShareKit method swizzling in Lion / Xcode 4.3.1?

天大地大妈咪最大 提交于 2019-12-06 07:30:49
I recently upgraded to Lion and Xcode 4.3.1 with the iOS 5 SDK, and the sharing library ShareKit is broken - it used method swizzling for its email handler. Apparently Apple has banned or at least attempted to phase out method swizzling. ShareKit imports a file </usr/include/objc/objc-class.h> , which no longer exists, and defines its own method swizzling method SHKSwizzle . It uses this to alter MFMailComposeViewController 's viewDidDisappear: method as follows: SHKSwizzle([MFMailComposeViewController class], @selector(viewDidDisappear:), @selector(SHKviewDidDisappear:)); What do you think is

MFMailComposeViewController crashing while dismissModalViewControllerAnimated in iOS5

十年热恋 提交于 2019-12-06 05:19:08
问题 I am using MFMailComposeViewController in my conde to provide Mail functionality but after sending mail or when i want to cancel mail it will be crashing. below is my code: (IBAction)FnForPlutoSupportEmailButtonPressed:(id)sender { { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; [mailer setSubject:@"Need help from Pluto support team"]; NSArray *toRecipients = [NSArray

SwiftUI: Send email

蓝咒 提交于 2019-12-05 08:11:43
In a normal UIViewController in Swift, I use this code to send a mail. let mailComposeViewController = configuredMailComposeViewController() mailComposeViewController.navigationItem.leftBarButtonItem?.style = .plain mailComposeViewController.navigationItem.rightBarButtonItem?.style = .plain mailComposeViewController.navigationBar.tintColor = UIColor.white if MFMailComposeViewController.canSendMail() { self.present(mailComposeViewController, animated: true, completion: nil) } else { self.showSendMailErrorAlert() } How can I achieve the same in SwiftUI? Do I need to use

Cancelling MFMailComposeViewController causes a memory leak?

谁都会走 提交于 2019-12-05 05:15:18
I use MFMailComposeViewController in an app I'm working on now. When user taps on a button, email form pops up. Now when I use instruments to monitor memory during this process I see that every time you push the cancel button and the action sheet appears, about 2.5 mb of memory adds up to live bytes in all heap & anonymous vm. This only occurs if you tap the cancel button, everything runs normally when you send the email. Btw I checked Apple's MessageComposer sample code here , it has the same issue. Does anyone know what might be the reason? Sounds like a memory leak in the API (UIKit) - they

How to embed an image in the HTML body of an email in iOS

只谈情不闲聊 提交于 2019-12-05 04:36:30
I'm trying to include an image in the body of an HTML email sent from an iPad. It seems impossible. I have tried to use the CID approach, but it seems that in iOS it is not possible to get/set the CID of attachments. I've also tried to embed the image with src="data:image/png;base64, blahblahblah" . When you compose the mail it seems to work, but nothing appears when the mail is received. Any ideas? More Detail : We are not looking for a solution where the JPEG/PNG is attached at the bottom of an email. That's easy to do with [composer addAttachmentData:mimeType:fileName:] . We are looking for

MFMailComposeViewController with recipient display-name as well as email address

我与影子孤独终老i 提交于 2019-12-05 03:31:31
I find that I can [picker setToRecipients:[NSArray arrayWithObject:@"My Name <myname@example.com>"]]; and it nicely displays "My Name" in the To: field when composing the email, and delivers it correctly to myname@example.com, on my iPad device. Looks good in the iPad simulator too (can't send though of course). But the iPhone simulator just shows "1 recipient" on the compose screen. Don't know whether it would send it ok or not, don't have an iPhone device handy to test that. Has anyone else gone down this path? Any way of getting the display-name on the iPhone compose screen? Thanks OK got

MFMessageComposeViewController appearance iOS 7

扶醉桌前 提交于 2019-12-05 02:36:43
I have an appearance proxy that sets the barTintColor property to green on UINavigationBar [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:54./255 green:165./255 blue:53./255 alpha:1]]; As needed I override this using appearanceWhenContainedIn: [[UINavigationBar appearanceWhenContainedIn:[INFSearchViewController class], nil] setBarTintColor:[UIColor colorWithWhite:0.80 alpha:1]]; This works fine. However when I present an MFMessageComposeViewController it adheres to the UINavigationBar proxy and looks like the following. Which obviously looks terrible, I would prefer

Attaching .txt to MFMailComposeViewController

ぐ巨炮叔叔 提交于 2019-12-05 00:02:25
I have a .txt file stored in Documents Folder and I want to send it by MFMailComposeViewController with next code in the body of -sendEmail method: NSData *txtData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"dataBase" ofType:@"txt"]]; [mail addAttachmentData:txtData mimeType:@"text/plain" fileName:[NSString stringWithFormat:@"dataBase.txt"]]; When Mail composer appears I can see attachment in the mail body but I receive this mail without attachment. Maybe it is wrong MIME-type for .txt attachment or something wrong with this code? Thanks NSArray *paths =

MFMailComposeViewController dismisses right away

淺唱寂寞╮ 提交于 2019-12-04 22:21:20
The situation is the MFMailComposeViewController was going to be presented. I saw it was presented half-way done, but then it got dismissed. This is the error: _serviceViewControllerReady:error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" This is my source code to present the MFMailComposeViewController: -(void) MailExecute { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init]; mailViewController

changing the MFMailComposeViewController navigationBar title font

拜拜、爱过 提交于 2019-12-04 17:56:37
I have a MFMailComposeViewController and when I've set the subject it also sets it as the subject. The question is how do I customize the font of the title and color? MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; [picker setSubject:@"Feedback for MyApp"]; i've changed the font generally for my apps from the app-delegate for all navigation bars of all view controllers. if you don't mind it changing all of your navigation bar title fonts, put something like the following in applicationDidFinishLaunching:withOptions: if ([[UINavigationBar class]