Open a file using an application on iOS Simulator?

How to open a file (this is an XML file) using the iOS application that I am developing. I want to check my implementation: UIApplicationLaunchOptionsURLKey . How can I do it? iOS Simulator does not ship with Mail or anything else, so I don’t know how to test this feature. Any ideas?

I made document types in the Xcode Target Properties object bit, so I am sure that is correct:

 <dict> <key>CFBundleTypeIconFiles</key> <array> <string>icon</string> </array> <key>CFBundleTypeName</key> <string>XML File</string> <key>LSItemContentTypes</key> <array> <string>public.XML</string> </array> </dict> 
+2
source share
3 answers

You need something similar to this:

 <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>XML File</string> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>public.xml</string> </array> </dict> </array> 

This should be a single entry in the Info.plist file.

+1
source

You just need to drag the file onto the simulator. If your application is registered for this type of file, your application will open and process it.

+4
source

Using Apple's sample application , you can include your file in this application, and it will allow you to do "open" where you can select your application.

+3
source

Source: https://habr.com/ru/post/954579/


All Articles