HUBJSONCompatibleBuilder
@protocol HUBJSONCompatibleBuilder <NSObject>
Protocol defining the public API for adding JSON data to a Hub Framework model builder
Builders that support JSON data will conform to this protocol. Most builders only support Dictionary-based
JSON, except for HUBViewModelBuilder that supports Array-based JSON for defining an array of body
component models.
-
Add binary JSON data to the builder
The builder will use its feature’s
HUBJSONSchemato parse the data that was added, and return any error that occured while doing so, or nil if the operation was completed successfully.Declaration
Objective-C
- (nullable NSError *)addJSONData:(nonnull NSData *)JSONData;Parameters
JSONDataThe JSON data to add
-
Add a JSON dictionary to this builder
The content that was extracted from the supplied dictionary will replace any previously defined content.
Declaration
Objective-C
- (void)addDataFromJSONDictionary: (nonnull NSDictionary<NSString *, NSObject *> *)dictionary;Parameters
dictionaryThe JSON dictionary to extract content from
View on GitHub
Install in Dash
HUBJSONCompatibleBuilder Protocol Reference