10

I am using UIActivityViewController with my iphone application to share a picture and a text.

I use this tutorial to custom the text for the differents services :

https://www.albertopasca.it/whiletrue/objective-c-custom-uiactivityviewcontroller-icons-and-text/

every thing is perfect but I need html to format the mail.

I don't find any way to format the code with html, I have html tag...

is there a way to send mail via UIActivityViewController with html format? I don't want plain text

elp
  • 8,021
  • 7
  • 61
  • 120
amau96
  • 857
  • 1
  • 8
  • 19

1 Answers1

28

If you return NSString containing HTML then com.apple.UIKit.activity.Mail will interpret it as HTML.

NSString *body = @"<html><body><ul><li>one</li><li>two</li></ul></body></html>";

If you want to have HTML email body and plain text Twitter tweets then create a new class adopting the UIActivityItemSource protocol and implement activityViewController:itemForActivityType:

tomi44g
  • 3,266
  • 1
  • 20
  • 28