Many of you guys use app's "Documents Directory" to store your files(image,video,pdf,music etc) in iOS app and being an iOS developer, it's obvious that you use documents directory since for each app,its the best way to store your files on the device permanently ,so that your app can function properly in offline mode too.
However, if you are trying to store large number of files (obvious referring both in quantity and size) in app's documents directory, then i will say STOP & WAIT!!!
- "STOP" because your app gonna be rejected by Apple because according to Apple's latest iOS Data Storage Guidelines : "Since iCloud backups are performed daily over Wi-Fi for each user’s iOS device, it’s important to ensure the best possible user experience by minimizing the amount of data being stored by your app." In summery i will say there are two points, every files in NSDocumnetsDirectory will be synced to user's iCloud and another is,if file sizes stored in NSDocumnetsDirectory are large then Apple will reject it since that causes the slow down on syncing process as iCloud-device syncs on daily basis.
-"WAIT" because i have a solution for it.
As pointed above if you are going to save files in NSDocumentDirectory then it will be back-up to iCloud,that means any thing you store in documents folder, will be synced to user's iCloud and will be publicly available. So if your files stored in documents directory makes no sense by being public then you don't have to worry about anything(unless its size is bigger), but if your file stored there are large in size and can not be public,or i say if these files are only intended just for the scope of your app then you must have to do extra work to prevent from being synced to iCloud.
There are two solutions for it :