HUBIdentifier

@interface HUBIdentifier : NSObject <NSCopying>

A component identifier is used to match a HUBComponentModel to a HUBComponent implementation

Component identifiers have two parts; a namespace and a name. The namespace is used to resolve which HUBComponentFactory to use to create a component for a model, and the name is then passed to that factory when it’s asked to create a component.

You can create component identifiers programmatically, or supply string representations when using JSON data using the namespace:name format.

  • The namespace of the component to use. Will me used to resolve a registered HUBComponentFactory.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull namespacePart;
  • The name of the component to use. Will be sent to the component factory that will create a component.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull namePart;
  • A string representation of the identifier, in the namespace:name format.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull identifierString;
  • Initialize an identifier

    Declaration

    Objective-C

    - (nonnull instancetype)initWithNamespace:(nonnull NSString *)namespacePart
                                         name:(nonnull NSString *)namePart;

    Parameters

    namespacePart

    The namespace part of the identifier

    namePart

    The name part of the identifier

  • Undocumented

    Declaration

    Objective-C

    @interface HUBIdentifier : NSObject <NSCopying>
  • Undocumented

    Declaration

    Objective-C

    @interface HUBIdentifier : NSObject <NSCopying>
  • Undocumented

    Declaration

    Objective-C

    @interface HUBIdentifier : NSObject <NSCopying>
  • Initialize an identifier with a string

    Declaration

    Objective-C

    - (nullable instancetype)initWithString:(nonnull NSString *)string;

    Parameters

    string

    The string to parse into an identifier. The string needs to have the namepsace:name format, otherwise nil is returned.

  • Compare two identifiers for equality

    Returns YES if both the namespace and name parts are equal in both objects.

    Declaration

    Objective-C

    - (BOOL)isEqualToIdentifier:(nonnull HUBIdentifier *)identifier;

    Parameters

    identifier

    Th identifier to compare this instance to