iOS Swift - Local Data Persistence
You want to save a user's preferred theme setting as a Boolean in UserDefaults and then read it safely with a default of false if not set. Which code snippet correctly does this?
set(_:forKey:) with a Bool value.bool(forKey:) returns the saved value or false if none exists, matching the requirement.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions