Swift Package Index



  • The latest stable release is 0.3.0. Released 7 months ago.
  • The last commit to master was 7 months ago.

Swift Version Compatibility

  • 0.3.0 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 0.3.0 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

JSONFactorable

Package Validation Status Coverage Status

Installation

Swift Package Manager (recommended)

Add you dependency to the project. For more info about how to do that read Apple's docs

CocoaPods

  1. Add pod to your Podfile:
pod 'JSONFactorable'
  1. Install pods:
pod install

Usage

  1. Import framework in your project:
import JSONFactorable
  1. Add extension to JSONFactorable which contains functions used by every factory like buildObject(of:) function.

  2. Looking for more detailed examples of usage look into Tests folder

Merging example

To merge two (or more) objects representable by a dictionary (or an array) follow the example:

var jsonConvertible: AnyJSONConvertible = [
  "key": AnyJSONConvertible(someValue)
]
let mergedJSON = try jsonConvertible.merge(with: AnyJSONConvertible(someObject))

where someObject conforms to JSONObjectType protocol

Contribution

Feel free to add your pull request or create an issue.

Requirements