Skip to content

Repository files navigation

ReactiveCodable

Swift 4.0Platform

ReactiveSwift JSON parsing helpers for Swift 4 JSON decoding. Inspired by: ReactiveMapper

Usage

ReactiveSwift

ReactiveCodable supports JSON mapping for ReactiveSwift on values in a Signal or SignalProducer stream.

// Create model from a JSON dictionary
letjsonSignalProducer:SignalProducer<Data,NSError>= // ...
jsonSignalProducer.mapToType(User.self).startWithResult{ result in
// use the decoded User model
letuser:User?= result.value
}
// Create array of models from array of JSON dictionaries
letjsonSignalProducer:SignalProducer<Any,NSError>= // ...
jsonSignalProducer.mapToType([Task].self).startWithResult{ result in
// use the decoded array of Task models
lettasks:[Task]?= result.value
}

Version Compatibility

Current Swift compatibility breakdown:

Swift VersionFramework Version
4.x1.x

Installation

Carthage

Add the following line to your Cartfile.

github "gunterhager/ReactiveCodable"

Then run carthage update.

About

ReactiveSwift JSON parsing helpers for Swift 4 JSON decoding.

Topics

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages