SyntaxFix
Write A Post
Hire A Developer
Questions
Extend UserDefaults once to don't copy-paste this solution:
UserDefaults
extension UserDefaults { func hasValue(forKey key: String) -> Bool { return nil != object(forKey: key) } } // Example UserDefaults.standard.hasValue(forKey: "username")