louisdh / textor

A plain text editor for iOS
MIT License
585 stars 113 forks source link

App Extension Best Practices #10

Open nixzhu opened 6 years ago

nixzhu commented 6 years ago

I have watched a WWDC session recently. I think maybe use a NSItemProvider for UIActivityViewController is better.

https://developer.apple.com/videos/play/wwdc2015/224/ (from 08:00)

As this video shows, a NSItemProvider can register different items, for example, kUTTypePlainText or kUTTypePDF.

And text file does not have a default preview image in system's share action. NSItemProvider.previewImageHandler can let host app to provide one.

I never use a NSItemProvider before, so there is not a pull request from me, sorry about that.