HUBViewURIPredicate

@interface HUBViewURIPredicate : NSObject

Class used to define predicates that evaulates whether a view URI should be handled by the Hub Framework

A view URI predicate is passed when registering a feature with HUBFeatureRegistry, and is used by the Hub Framework to determine whether it should handle a certain view URI when a view controller or view model loader is requested.

You can construct simple predicates that only successfully evaluates a constant view URI, or enable a tree of view URIs using a root view URI, as well as using a block or NSPredicate to construct complex predicates that evaluate based on any condition.

  • Create a predicate that only allows a single, constant view URI

    Declaration

    Objective-C

    + (nonnull HUBViewURIPredicate *)predicateWithViewURI:(nonnull NSURL *)viewURI;

    Parameters

    viewURI

    The only view URI that the predicate should qualify. Any other view URI will be disqualified.

  • Create a predicate that allows view URIs that have a root view URI as a prefix

    Declaration

    Objective-C

    + (nonnull HUBViewURIPredicate *)predicateWithRootViewURI:
        (nonnull NSURL *)rootViewURI;

    Parameters

    rootViewURI

    The root view URI that the predicate should be based on. The predicate will qualify this view URI, as well as any URI that has this one as a prefix.

  • Create a predicate that allows view URIs that have a root view URI as a prefix, exluding a set of view URIs

    Declaration

    Objective-C

    + (nonnull HUBViewURIPredicate *)
    predicateWithRootViewURI:(nonnull NSURL *)rootViewURI
            excludedViewURIs:(nonnull NSSet<NSURL *> *)exludedViewURIs;

    Parameters

    rootViewURI

    The root view URI that the predicate should be based on

    exludedViewURIs

    A set of view URIs that should be excluded from qualification, even if they match the prefix requirement set by rootViewURI.

  • Create a predicate with an NSPredicate

    The returned predicate will return the outcome of sending any evaluated view URI to the underlying NSPredicate.

    Declaration

    Objective-C

    + (nonnull HUBViewURIPredicate *)predicateWithPredicate:
        (nonnull NSPredicate *)predicate;

    Parameters

    predicate

    The predicate that the view URI predicate should be based on. The predicate should be set up to evaluate NSURL instances.

  • Create a predicate with a block

    The returned predicate will return the outcome of sending any evaluated view URI to its block.

    Declaration

    Objective-C

    + (nonnull HUBViewURIPredicate *)predicateWithBlock:
        (nonnull BOOL (^)(NSURL *_Nonnull))block;

    Parameters

    block

    The block used to evaluate view URIs

  • Initialize an instance of this class with a block

    Declaration

    Objective-C

    - (nonnull instancetype)initWithBlock:(nonnull BOOL (^)(NSURL *_Nonnull))block;

    Parameters

    block

    The block used to evaluate view URIs

  • Undocumented

    Declaration

    Objective-C

    @interface HUBViewURIPredicate : NSObject
  • Undocumented

    Declaration

    Objective-C

    @interface HUBViewURIPredicate : NSObject
  • Undocumented

    Declaration

    Objective-C

    @interface HUBViewURIPredicate : NSObject
  • Evaluate a view URI

    Declaration

    Objective-C

    - (BOOL)evaluateViewURI:(nonnull NSURL *)viewURI;

    Parameters

    viewURI

    The view URI that should be evaluated, based on the underlying rules of the predicate.