Created
January 2, 2013 20:09
-
-
Save codeswimmer/4437512 to your computer and use it in GitHub Desktop.
iOS: Sharing Files With The User
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From Apple. | |
| An application that wants to make files accessible to the user can do so through the file sharing feature. File sharing exposes the contents of an application’s Documents directory in iTunes. Exposing this directory allows the user to add files to it or delete files from it. To enable file sharing for your application, do the following: | |
| Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES. | |
| Put whatever files you want to share in your application’s Documents directory. | |
| When the device is plugged into the user’s computer, iTunes displays a File Sharing section in the Apps pane of the selected device. The user can add files to this directory or move files to the desktop. | |
| Applications that support file sharing should be able to recognize when files have been added to the Documents directory and respond appropriately. You should never present the user with the list of files in this directory and ask them to decide what to do with those files. Instead, sort through the files programmatically and add files without prompting. Similarly, if the user deleted files, remove those files from any relevant parts of your user interface. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment