Confuse !! How Dropbox or any PDF Reader kind application can open(handle) files of your email!!
For example, PDF Expert or any other PDF viewer is installed in you device, and when you tried to open PDF file from Email, it will ask Open In "PDF Expert" or Open In "PDF Viewer". Let's go and make a application which can open ".xml" file and ".m" source-code file. Add below XML code to info.plist file of your project.
your Info.plist will look like below,
Info.plist
Now, Run your project any device. Send e-mail containing attachment as .XML and .m files You can see attachment will have option to Open In "YOUR_APP". See below Screenshots of my device, XML File,
XML file
.m File,
.m File
See full list of supported extensions (UTIs) here. You can handle this file in AppDelegate.m, See below code.