Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import and Export file with iTunes from an IOS app

Tags:

import

ios

swift

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

like image 657
hgcahez Avatar asked Sep 29 '15 18:09

hgcahez


1 Answers

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

like image 195
Xhacker Liu Avatar answered Sep 17 '22 23:09

Xhacker Liu