CKComponentHostingView Class Reference

Conforms to :
<
>
ContextType
ModelType
NSObject
__covariant
id
Declared in CKComponentHostingView.h
CKComponentHostingViewInternal.h

Overview

A view that renders a single component.

Other Methods

  delegate

Notified when the view’s ideal size (measured by -sizeThatFits:) may have changed.

@property (nonatomic, weak) id<CKComponentHostingViewDelegate> delegate

Declared In

CKComponentHostingView.h

– initWithComponentProviderFunc:sizeRangeProvider:

Convenience initializer that uses default analytics listener

- (instancetype)initWithComponentProviderFunc:(CKComponent *( *) ( ModelType model , ContextType context ))componentProvider sizeRangeProvider:(id<CKComponentSizeRangeProviding>)sizeRangeProvider

Parameters

componentProvider

provider conforming to CKComponentProvider protocol.

sizeRangeProvider

sizing range provider conforming to CKComponentSizeRangeProviding.

Declared In

CKComponentHostingView.h

– initWithComponentProvider:sizeRangeProvider:

This method is deprecated. Please use initWithComponentProviderFunc:sizeRangeProvider:

- (instancetype)initWithComponentProvider:(Class<CKComponentProvider>)componentProvider sizeRangeProvider:(id<CKComponentSizeRangeProviding>)sizeRangeProvider

Declared In

CKComponentHostingView.h

– updateModel:mode:

Updates the model used to render the component.

- (void)updateModel:(ModelType)model mode:(CKUpdateMode)mode

Declared In

CKComponentHostingView.h

– updateContext:mode:

Updates the context used to render the component.

- (void)updateContext:(ContextType)context mode:(CKUpdateMode)mode

Declared In

CKComponentHostingView.h

– hostingViewWillAppear

Appearance events to be funneled to the component tree.

- (void)hostingViewWillAppear

Declared In

CKComponentHostingView.h

Other Methods

– initWithComponentProvider:sizeRangeProvider:componentPredicates:componentControllerPredicates:analyticsListener:options:

provider conforming to CKComponentProvider protocol.

- (instancetype)initWithComponentProvider:(Class<CKComponentProvider>)componentProvider sizeRangeProvider:(id<CKComponentSizeRangeProviding>)sizeRangeProvider componentPredicates:(const std : : unordered_set<CKComponentPredicate> &)componentPredicates componentControllerPredicates:(const std : : unordered_set<CKComponentControllerPredicate> &)componentControllerPredicates analyticsListener:(id<CKAnalyticsListener>)analyticsListener options:(const CKComponentHostingViewOptions &)options

Parameters

componentProvider

provider conforming to CKComponentProvider protocol.

sizeRangeProvider

sizing range provider conforming to CKComponentSizeRangeProviding.

componentPredicates

A vector of C functions that are executed on each component constructed within the scope root. By passing in the predicates on initialization, we are able to cache which components match the predicate for rapid enumeration later.

componentControllerPredicates

Same as componentPredicates above, but for component controllers.

analyticsListener

listener conforming to AnalyticsListener will be used to get component lifecycle callbacks for logging

options

Set of CKComponentHostingViewOptions

Declared In

CKComponentHostingViewInternal.h

– applyResult:

Applies a result from a component built outside the hosting view. Main thread only.

- (void)applyResult:(const CKBuildComponentResult &)result

Declared In

CKComponentHostingViewInternal.h

– reloadWithMode:

Calling this method will re-generate the underlying component hierarchy without component reuse. Use case could be reloading a hosting view when CKComponentContext should be updated.

- (void)reloadWithMode:(CKUpdateMode)mode

Declared In

CKComponentHostingViewInternal.h