Add you dependency to the project. For more info about how to do that read Apple's docs
- Add pod to your Podfile:
pod'JSONFactorable'- Install pods:
pod install- Import framework in your project:
import JSONFactorableAdd extension to
JSONFactorablewhich contains functions used by every factory likebuildObject(of:)function.Looking for more detailed examples of usage look into Tests folder
To merge two (or more) objects representable by a dictionary (or an array) follow the example:
varjsonConvertible:AnyJSONConvertible=["key":AnyJSONConvertible(someValue)]letmergedJSON=try jsonConvertible.merge(with:AnyJSONConvertible(someObject))where someObject conforms to JSONObjectType protocol
Feel free to add your pull request or create an issue.
- Xcode 11.3+