Daily iOS
Persistence

Picking a local store

A new iOS project has to store a favorites list, the login session, downloaded PDFs, and display settings locally. Which store would you pick for each?

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

Favorites go to SwiftData (a list that grows, with search and sorting), the session to the Keychain, PDFs to files (the caches directory when you can download them again), and settings to UserDefaults. You decide on size, structure, security, and lifetime (whether it gets backed up).

Share a question