Latest 0.1.0
Homepage https://github.com/ReImpl/TypedPreferences
License MIT
Platforms ios 8.0, watchos 2.0, osx 10.9, requires ARC
Authors

Version
License
Platform

Description

UserDefaults interface is not strictly-typed.
TypedPreferences enables class implementation where all dynamic @objc-declared properties are automatically saved/loaded to/from UserDefaults.

Thus:

// Instead of:
let defaults = UserDefaults.standard
print("name: (defaults.value(forKey: "name") as? String)")
defaults.set("Updated name", forKey: "name")

// Typed property-based usage looks like:
let preferences = YourPreferencesSubclass()
print("name: (preferences.name)")
preferences.name = "Updated name"

Installation

TypedPreferences is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'TypedPreferences'

License

TypedPreferences is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "TypedPreferences",
    "version": "0.1.0",
    "platforms": {
        "ios": "8.0",
        "watchos": "2.0",
        "osx": "10.9"
    },
    "summary": "Typed property-based UserDefaults for Swift.",
    "description": "Save your application settings using strictly-typed keys and safely store/load via UserDefaults in Swift and ObjC.",
    "homepage": "https://github.com/ReImpl/TypedPreferences",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "kernel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ReImpl/TypedPreferences.git",
        "tag": "0.1.0"
    },
    "source_files": "TypedPreferences/Classes/**/*",
    "swift_version": "4.1",
    "requires_arc": true
}

Pin It on Pinterest

Share This