CKComponentLifecycleManager Class Reference
Inherits from | NSObject |
---|---|
Declared in | CKComponentLifecycleManager.h |
– initWithComponentProvider:
Designated initializer
- (instancetype)initWithComponentProvider:(Class<CKComponentProvider>)componentProvider
Declared In
CKComponentLifecycleManager.h
asynchronousUpdateHandler
See @protocol CKComponentLifecycleManagerAsynchronousUpdateHandler
@property (nonatomic, weak) id<CKComponentLifecycleManagerAsynchronousUpdateHandler> asynchronousUpdateHandler
Declared In
CKComponentLifecycleManager.h
– updateWithStateWithoutMounting:
Updates the state to the new one without mounting the view.
- (void)updateWithStateWithoutMounting:(const CKComponentLifecycleManagerState &)state
Discussion
If you are lazily mounting and unmounting the view (like in a datasource), this is the method to call during a state mutation.
Declared In
CKComponentLifecycleManager.h
– updateWithState:
Updates the state to the new one.
- (void)updateWithState:(const CKComponentLifecycleManagerState &)state
Discussion
If we have a view mounted, we remount the view to pick up the new state.
Declared In
CKComponentLifecycleManager.h
– attachToView:
Attaches the manager to the given view. This will display the component in the view and update the view whenever the component is updated due to a model or state change.
- (void)attachToView:(UIView *)view
Discussion
Only one manager can be attached to a view at a time. If the given view already has a manager attached, the previous manager will be detached before this manager attaches.
This method efficiently recycles subviews from the previously attached manager whenever possible. Any subviews that could not be reused are hidden for future reuse.
Attaching will not modify any subviews in the view that were not created by the components infrastructure.
Declared In
CKComponentLifecycleManager.h
– detachFromView
Detaches the manager from its view. This stops the manager from updating the view’s subviews as its component updates.
- (void)detachFromView
Discussion
This does not remove or hide the existing views in the view. If you attach a new manager to the view, it will recycle the existing views.
Declared In
CKComponentLifecycleManager.h
– isAttachedToView
Returns whether the lifecycle manager is attached to a view.
- (BOOL)isAttachedToView
Declared In
CKComponentLifecycleManager.h
– size
The current top-level layout size for the component
- (CGSize)size
Declared In
CKComponentLifecycleManager.h
– model
The last model associated with this lifecycle manager
- (id)model
Declared In
CKComponentLifecycleManager.h
– scopeRoot
The current scope frame associated with this lifecycle manager
- (CKComponentScopeRoot *)scopeRoot
Declared In
CKComponentLifecycleManager.h