This library allows encoding and decoding of dynamic data structures via Swift Codable.
Date
and Data
can be converted in runtime from the String
type.
Add the following dependency to your Package.swift:
.package(url: "https://github.com/tesseract-one/Serializable.swift.git", from: "0.3.0")
Run swift build
and build your app.
Add the following to your Podfile:
pod 'Serializable.swift' '~> 0.3'
Then run pod install
.
Sources/Serializable
folder in your project.import Foundation
import Serializable
let json = """
{
"message": "Hello, World!"
}
""".data(using: .utf8)!
let value = try! JSONDecoder().decode(AnyValue.self, from: json)
print("Message:", value["message"]!.string!)
Serializable.swift is available under the Apache 2.0 license. See the LICENSE file for more information.
link |
Stars: 1 |
Last commit: 3 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics