Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Addison Francisco slo-addy

👋
  • San Luis Obispo, CA
View GitHub Profile
@slo-addy
slo-addy / AlternativeExampleUserNameStorage.swift
Created May 13, 2022
An alternative example of a simple user name storage using UserDefaults that includes basic tests. This is in reference to https://www.youtube.com/watch?v=8IiRB28N5OI
View AlternativeExampleUserNameStorage.swift
import Foundation
protocol CredentialKeeper {
func store(userName: String)
func getUserName() -> String?
}
class UserCredentialStorage: CredentialKeeper {
var userDefaults: UserDefaults = .standard