UserDefaults
good for? What is UserDefaults
not good for?Suggested approach: This should immediately have you thinking about speed, size, and security: UserDefaults
is bad at large amounts of data because it slows your app load, it’s annoying for complex data types because of NSCoding
, and a bad choice for information such as credit cards and passwords – recommend the keychain instead. If you’re using SwiftUI extensively you could mention @AppStorage
here.
Estimated difficulty: Easy
Watch me answer this question in detail
See the full list of iOS interview questions
Link copied to your pasteboard.