Sunday, January 29, 2017

Enable iOS Data Protection

How to enable build-in iOS data protection for Core Data SQLite file:
Data protection adds a level of security to files stored on disk by your app in the app’s container. It uses built-in iOS encryption to encrypt files on disk. You should enable Data Protection under Capabilities to enable the same.

Then you can use Data Protection options
  1. NSDataWritingFileProtectionNone (No Protection)
  2. NSFileProtectionComplete(CompleteProtection)
  3. NSDataWritingFileProtectionCompleteUnlessOpen(Protected when Device Locked)
  4.  NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication or NSFileProtectionCompleteUntilFirstUserAuthentication (Protected on first access and device has been booted).

Watch below video demonstrating the same:

No comments:

Post a Comment