Latest 1.0.1
Homepage https://github.com/Ucself/JGCache
License MIT
Platforms ios 8.0
Dependencies ObjectMapper
Authors

CI Status
Version
License
Platform

Example


class UserModel: Mappable {

    var id:String = ""
    var name:String = ""

    init() {}
        required init?(map: Map) {

    }
    func mapping(map: Map) {
        id <- map["id"]
        name <- map["name"]
    }
}

let userDefault = UserModel.init()
userDefault.id = "我是default的id"
userDefault.name = "我是default的name"
//写入缓存
if JGCacheManager.default.writeCacheModel(object: userDefault) {
    print("👉userDefault write Successful")
}
else {
    print("👉userDefault write failure")
}

//读取缓存
if let userDefault = JGCacheManager.default.getCacheModel(class: UserModel.self) {
    print("👉userDefault get id -> (userDefault.id);name -> (userDefault.name)")
}
else {
    print("👉userDefault get nil")
}

//移除缓存
if JGCacheManager.default.removeCacheModel(class: UserModel.self) {
    print("👉userDefault remove Successful")
}
else {
    print("👉userDefault remove failure")
}

Requirements

The Basics -> ObjectMapper

Installation

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

pod 'JGCache'

Author

李保君, [email protected]

License

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

Latest podspec

{
    "name": "JGCache",
    "version": "1.0.1",
    "summary": "this is description",
    "description": "TODO: this is description",
    "homepage": "https://github.com/Ucself/JGCache",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u674eu4fddu541b": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Ucself/JGCache.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "JGCache/Classes/**/*",
    "dependencies": {
        "ObjectMapper": [
            "~> 3.0.0"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This