Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityView attach file to Email

I've created an UIActivityView inside my iPad App but I don't know how to attach a file when sending an email. How can I do?

like image 991
user1679847 Avatar asked Dec 27 '22 15:12

user1679847


1 Answers

I think it will help you.

NSData *pdfData = [NSData dataWithContentsOfFile:pdfFilePath];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"Test", pdfData] applicationActivities:nil];

[self presentViewController:activityViewController animated:YES completion:nil];
like image 185
Ned Avatar answered Jan 15 '23 01:01

Ned