Daily iOS
Persistence

Data Protection classes

You have logs where the app, woken by a background push while the screen is locked, fails to open its local database. What is file protection (Data Protection) on iOS?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Data Protection is a class per file that decides whether the file's key can be used depending on the lock state (complete, unlessOpen, untilFirstUserAuthentication, none), and the default is accessible from the first unlock onward.

Share a question