Latest 1.0.1
Homepage https://github.com/vincentLin113/EasyUserDefault
License MIT
Platforms ios 8.0
Authors

Swift
Cocoapods Compatible

Easy and elegant uses UserDefault.

Requirements

  • iOS 8.0+
  • Swift 3.0+

Installation

CocoaPods

available on CocoaPods. Just add the following to your project Podfile:

pod 'EasyUserDefault'
use_frameworks!

import the library in all files where you use it:

import EasyUserDefault

Usage

See the code snippet below for an example of how to implement

Create

let storedObject = EasyUserDefault(key: "yourIdentifier")

Store value

  • [x] supported: String, Integer, Dictionary, Array, Boolean
    storedObject.store(yourValue)

Get value

storedObject.storedRawValue()
storedObject.storedRawValue<String>()
let dict = try? storedObject.storedValue<[String, Any]>()

Cool feature

storedObject.string           // Optional string
storedObject.stringValue      // Non-optional string
storedObject.dictionary       // Optional dictionary
storedObject.dictionaryValue  // Non-optional dictionary
storedObject.array            // Optional array
storedObject.arrayValue       // Non-optional array
storedObject.bool             // Optional bool
storedObject.boolValue        // Non-optional bool

Check

storedObject.exist()

Author

Vincent Lin

License

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

Latest podspec

{
    "name": "EasyUserDefault",
    "version": "1.0.1",
    "summary": "Easy and elegant uses UserDefault",
    "description": "Check any valid type before you save or after saved",
    "homepage": "https://github.com/vincentLin113/EasyUserDefault",
    "license": "MIT",
    "authors": {
        "Vincent Lin": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/vincentLin113/EasyUserDefault.git",
        "tag": "1.0.1"
    },
    "source_files": "EasyUserDefault/Source/**/*.{h,m,swift}",
    "swift_version": "3.3"
}

Pin It on Pinterest

Share This