How can I control the order UIActivityItemSource data is added ?

I'm using UIActivityViewController with a set of custom UIActivityItemSource objects. Like this:


let items = [ titleWrapper,  imageWrapper, bodyWrapper, pdfWrapper ]
UIActivityViewController = UIActivityViewController.init(activityItems: items, applicationActivities: nil)


Items is an array of UIAcivityItemSource subclasses - some return text (String) others return an image or a PDF, etc.


In each activity item source, I block some of these from being included, for example, for UIActivity.ActivityType.mail I reutrn nil for the PDF, but not for the image, so, the image ends up in the email. Fine.

But, I cannot figure how to control the order. In my array of activityItems, I order them in the order I wish they would appear. But, in the email composer, I get

- title (String)

- body (String)

- image (UIImage)


Is there a way to get the image to appear first? Or even better, after the title string but before the body string. Or am I stuck with this?
Thanks.

Post not yet marked as solved Up vote post of JBAtIWS Down vote post of JBAtIWS
609 views