Last active
March 12, 2017 01:07
-
-
Save efremidze/e65fc763a161a549b52a800289c30943 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Storable {} | |
extension Storable { | |
var storedValue: Any? { | |
get { return UserDefaults.standard["value"] } | |
nonmutating set { UserDefaults.standard["value"] = newValue } | |
} | |
} | |
struct Storage: Storable {} | |
let storage = Storage() | |
storage.storedValue = "🐼" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment