Add “Edit in Excel” or “Edit photo” extension

The only way to communicate with other iOS apps “locally” is using what is called URLSchemes.

This is the documentation to use URLScheme with the MSOffice apps.
https://msdn.microsoft.com/en-us/library/office/dn911482.aspx

Answering the specific question:

How to check if file (image, xls, doc or any other) can be opened to edit?

You can use the UIApplication method called canOpenURL to check if the current device responds to a specific URLScheme and if it does, you can call the app to edit you file. The same can be applied to other apps that you want to open. You just need to see if the app have URLScheme support.

Remembering that in iOS 9 you need to add the URLs you want to call during the app life in the Info.plist. Otherwise, the canOpenURL method will always returno NO.

This code illustrates the approach. However, it is to search some navigation apps. Just like tapping a shared friend location in WhatsApp.

https://snipt.net/wallaaa/using-url-schemes/

The result:
result of navigation button

Leave a Comment