Latest 0.0.3
Homepage https://github.com/kuyazee/CodableKit
License MIT
Platforms ios 8.0
Authors

CodableKit

LinkedIn
Github
Cocoapods

CodableKit is available through the dependency manager CocoaPods.

===================

CodableKit is a library built to extend Swift’s Codable.

Installation

To install the CodableKit via cocoapods, simply use the add this in your podfile and then run pod install

pod 'Codable-Kit'

Usage

JSON Decoding

Without Type Inference

let decoder = JSONDecoder()
do {
    let user = try decoder.decode(User.self, from: userData)
} catch {
    print(error)
}

With Type Inference

let decoder = FileDecoder(decoder: JSONDecoder(), bundle: .main, fileManager: .default)
do {
    let user: User = try decoder.decode(userData)
} catch {
    print(error)
}

File Decoding

Without Type Inference

let decoder = FileDecoder(decoder: JSONDecoder(), bundle: .main, fileManager: .default)
do {
    let user = try decoder.decode(User.self, from: File(name: "user", type: "json"))
} catch {
    print(error)
}

With Type Inference

let decoder = FileDecoder(decoder: JSONDecoder(), bundle: .main, fileManager: .default)
do {
    let user: User = try decoder.decode(File(name: "user", type: "json"))
} catch {
    print(error)
}

Custom Decoders

TODO

References

Latest podspec

{
    "name": "Codable-Kit",
    "version": "0.0.3",
    "summary": "CodableKit is a library built to extend Swift's Codable",
    "description": "CodableKit is a library built to extend Swift's Codable. Made in Swift 4.2",
    "homepage": "https://github.com/kuyazee/CodableKit",
    "swift_version": "4.2",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Zonily Jame Pesquera": "[email protected]"
    },
    "social_media_url": "https://www.linkedin.com/in/zjgpesquera/",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/kuyazee/CodableKit.git",
        "tag": "0.0.3"
    },
    "source_files": "Sources/CodableKit/*.{h,m,swift}"
}

Pin It on Pinterest

Share This