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 HUBJSONSchema to 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

    JSONData

    The 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

    dictionary

    The JSON dictionary to extract content from