How to create a Settings manager in Swift 5.1

Think that you need to work with UserDefaults to save if user is logged in, or if onboarding is already showed. Your code looks like it: let userDefaults = UserDefaults.standard userDefaults.set(logged, forKey: "isLoggedIn") if UserDefaults.standard.bool(forKey: "isLoggedIn") { print("User Logged") } My propose is replace for it: AppSettings[.isLoggedIn] = true if AppSettings.boolValue(.isLoggedIn) { print("User Logged") }... Continue Reading →

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑