Swift date in user defaults Nov 24, 2020 let expires = defaults.object(forKey: defaultsTokenExpiresName) as? Date