Latest 0.1.3
Homepage https://github.com/tesseract-one/Serializable.swift
License Apache 2.0
Platforms ios 8.0, osx 10.9, tvos 9.0, watchos 2.0
Authors

Serializable

🐧 linux: ready
GitHub license
Build Status
GitHub release
Carthage compatible
CocoaPods version
Platform OS X | iOS | tvOS | watchOS | Linux

Dynamic value for Swift Codable

Goals

This library allows encoding and decoding of dynamic data structures via Swift Codable.

Supported types

  • Dictionary
  • Array
  • Bool
  • Float(Double)
  • Int
  • String
  • null

Additional types

Date and Data can be converted in runtime from the String type.

Getting started

Installation

Package Manager

Add the following dependency to your Package.swift:

.package(url: "https://github.com/tesseract-one/Serializable.swift.git", from: "0.1.0")

Run swift build and build your app.

CocoaPods

Add the following to your Podfile:

pod 'Serializable.swift'

Then run pod install.

Carthage

Add the following to your Cartfile:

github "tesseract-one/Serializable.swift"

Run carthage update and follow the steps as described in Carthage’s README.

Manually

  1. Download and drop Sources/Serializable folder in your project.
  2. Congratulations!

Examples

JSON parsing

import Foundation
import Serializable

let json = """
{
  "message": "Hello, World!"
}
""".data(using: .utf8)!

let value = try! JSONDecoder().decode(SerializableValue.self, from: json)

print("Message:", value.object!["message"].string!)

Author

License

Serializable.swift is available under the Apache 2.0 license. See the LICENSE file for more information.

Latest podspec

{
    "name": "Serializable.swift",
    "version": "0.1.3",
    "summary": "Dynamic Serializable Value for Swift Codable",
    "description": "Dynamic Serializable Value for Swift Codable. Allows encoding and decoding with Dictionary/Array types.",
    "homepage": "https://github.com/tesseract-one/Serializable.swift",
    "license": {
        "type": "Apache 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Tesseract Systems, Inc.": "[email protected]"
    },
    "source": {
        "git": "https://github.com/tesseract-one/Serializable.swift.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "pod_target_xcconfig": {
        "APPLICATION_EXTENSION_API_ONLY": "YES"
    },
    "module_name": "Serializable",
    "source_files": "Sources/Serializable/**/*.swift"
}

Pin It on Pinterest

Share This