HUBViewModelLoaderDelegate

@protocol HUBViewModelLoaderDelegate <NSObject>

Delegate protocol for HUBViewModelLoader

Conform to this protocol in a custom object to get notified when a view model was loaded, or if an error occured in the loading process.

  • Sent to a view model loader’s delegate when a view model was loaded

    Note that this method might be called multiple times during a view model loader’s lifecycle, as it will be called whenever a view model finished loading. This might happen either as the result of calling loadViewModel, whenever a content operation was rescheduled and completed, or whenever the current connectivity state was changed.

    Declaration

    Objective-C

    - (void)viewModelLoader:(nonnull id<HUBViewModelLoader>)viewModelLoader
           didLoadViewModel:(nonnull id<HUBViewModel>)viewModel;

    Parameters

    viewModelLoader

    The view model loader that loaded a view model

    viewModel

    The view model that was loaded

  • Sent to a view model loader’s delegate when an error occured, causing the loader to fail

    Declaration

    Objective-C

    - (void)viewModelLoader:(nonnull id<HUBViewModelLoader>)viewModelLoader
        didFailLoadingWithError:(nonnull NSError *)error;

    Parameters

    viewModelLoader

    The view model loader that encountered the error

    error

    The error that was encountered