hgcahez
hgcahez

Reputation: 413

Import and Export file with iTunes from an IOS app

I work with Xcode 7 and Swift 2 for create an IOS app. I want my users to import file in my application and recover the IOS device by connecting to iTunes. I would have to can access the file from my code ... Here is a sample application that offers this principle (VLC, Excel ...). And here's a screen for you to understand! ;) enter image description here

Upvotes: 6

Views: 6357

Answers (1)

Xhacker Liu
Xhacker Liu

Reputation: 1618

Here is a documentation: Core Services Layer

To enable file sharing for your app, do the following:

  1. Add the UIFileSharingEnabled key to your app’s Info.plist file, and set the value of the key to YES.
  2. Put whatever files you want to share in your app’s Documents directory.
  3. When the device is plugged into the user’s computer, iTunes displays a File Sharing section in the Apps tab of the selected device.
  4. The user can add files to this directory or move files to the desktop.

After enabling File Sharing, you could just manipulating the Documents directory.

You could also use a tutorial like this one:

iTunes Tutorial for iOS: How To Integrate iTunes File Sharing With Your iOS App

Upvotes: 17

Related Questions