Reputation: 14261
From the Apple documentation Encrypting Your App’s Files
Data protection is enabled automatically when the user sets an active passcode for the device.
However, there is a Capability that can be toggled on and add to the app's entitlements file, called "Data Protection" that under the description says
Data protection allows an app that accesses sensitive user data to use the built-in encryption available on some devices.
Is this capability just old legacy stuff, or do you actually need to enable it in order to get complete data protection?
Upvotes: 6
Views: 944
Reputation: 1688
Besides the files that you create programmatically in your code you also have the files that are in the application's bundles (e.g. resources bundles). These have the protection that is set in the Data Protection Entitlement (as you can see in the documentation the entitlement is under the resource bundle category for that reason). If for some reason you need to access bundle resources when the device is locked you will need to set a value different from the default, so there is a use case for the entitlement.
Upvotes: 2