Skip to content

Instantly share code, notes, and snippets.

View slo-addy's full-sized avatar
👋

Addison Francisco slo-addy

👋
  • San Luis Obispo, CA
View GitHub Profile
@slo-addy
slo-addy / AlternativeExampleUserNameStorage.swift
Created May 13, 2022 19:03
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
import Foundation
protocol CredentialKeeper {
func store(userName: String)
func getUserName() -> String?
}
class UserCredentialStorage: CredentialKeeper {
var userDefaults: UserDefaults = .standard