Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
let defaults = Defaults()
let hasLoggedIn = true, forKey: .LoggedIn), forKey: .NotificationsEnabled)
let regularOrder = Order(item: "Cold Brew", size: .Large)
let alternateOrder = Order(item: "Latte", size: .Small), forKey: .Alternate)
class Defaults {
func save<T: DefaultConvertible>(toSave: T, forKey key: T.Key = .Default) { ... }
func fetch<T: DefaultConvertible>(type: T.Type, forKey key: T.Key = .Default) -> T? { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.