Latest 1.0.0
License MIT
Platforms ios 9.0, requires ARC
Dependencies Inlinit

Swiftly Encode & Decode for Archiving & JSON



To run the example project, clone the repo, and run pod install from the Example directory first.

struct Person: Encodable {

    var name: String?
    var age: Int = 0

    init() { }

    init(_ info: EncodedInfo) {

        name <-- info["name"]
        age <-- info["age"]



Struct from Example project

struct Album: Encodable {

    var title: String?
    var artist: String?
    var albumImageURL: String?
    var albumImage: UIImage?
    var trackCount: Int?
    var collectionPrice: Double?

    init() { }

    init(_ info: EncodedInfo) {

        title <-- info["collectionName"]
        artist <-- info["artistName"]
        albumImageURL <-- info["artworkUrl100"]
        trackCount <-- info["trackCount"]
        collectionPrice <-- info["collectionPrice"]




This pod uses Inlinit (a pod that allows closure initalizers).


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

pod "Encodable"

Encodable is also available through Swift Package Manager. Please take a look at the link to learn more about how to use SwiftPM.

import PackageDescription

let package = Package(
    name: "YOUR_PACKAGE_NAME",
    dependencies: [
        .Package(url: "", majorVersion: 0)


Jo Albright


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

Latest podspec

    "name": "Encodable",
    "version": "1.0.0",
    "summary": "Swiftly Encode & Decode for Archiving & JSON",
    "description": "A simple way to convert properties into dictionary collections and backwards.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Jo Albright": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "social_media_url": "",
    "platforms": {
        "ios": "9.0"
    "requires_arc": true,
    "source_files": "Sources/*",
    "resource_bundles": {
        "Encodable": [
    "dependencies": {
        "Inlinit": [
            "~> 0.1"

Pin It on Pinterest

Share This