Latest 0.1.8
Homepage https://github.com/cmtrounce/WrappedValue
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Intro

Forget the struggle of having to manually parse Strings to Ints, Doubles and other data types!

Using the power of Codable, WrappedValue will automatically decode them for you, with some life-changing error handling.

Basic Usage


typealias WrappedInt = WrappedValue<Int>

struct Person: Codable {
  let age: WrappedInt
  let name: String
}

If your JSON API returns age as String "30", WrappedValue will handle the parsing of it to an Int as specified in the typealias

Access the Int through person.age.value.

In addition to Codable, WrappedValue also conforms to Hashable, Equatable and Numeric

Example

The Example project was built and tested using Travis CI.

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

Requirements

WrappedValue is compiled using Swift 5.0 in Xcode 10.2.
The project is compatible with Swift 4.2 and Swift 5.0

Installation

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

pod 'WrappedValue'

Author

cmtrounce, [email protected]

License

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

Latest podspec

{
    "name": "WrappedValue",
    "version": "0.1.8",
    "summary": "Forget the struggle of decoding Strings!",
    "swift_version": "5.0",
    "description": "Is your RESTful API returning Strings instead of Doubles? Are you tired of writing all that custom decoding? Let WrappedValue do it for you!",
    "homepage": "https://github.com/cmtrounce/WrappedValue",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "cmtrounce": "[email protected]"
    },
    "source": {
        "git": "https://github.com/cmtrounce/WrappedValue.git",
        "tag": "0.1.8"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "WrappedValue/Classes/**/*"
}

Pin It on Pinterest

Share This