railwaymen/jsonfactorable
Add you dependency to the project. For more info about how to do that read [Apple's docs](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app)
Installation
Swift Package Manager (recommended)
Add you dependency to the project. For more info about how to do that read Apple's docs
CocoaPods
- Add pod to your Podfile:
``ruby pod 'JSONFactorable' ``
- Install pods:
``bash pod install ``
Usage
- Import framework in your project:
``swift import JSONFactorable ``
- Add extension to
JSONFactorablewhich contains functions used by every factory likebuildObject(of:)function.
- 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
- Xcode 11.3+
Package Metadata
Repository: railwaymen/jsonfactorable
Default branch: master
README: README.md