CKCompositeComponent Class Reference
Inherits from | CKComponent : NSObject |
---|---|
Declared in | CKCompositeComponent.h |
Overview
CKCompositeComponent allows you to hide your implementation details and avoid subclassing layout components like CKStackLayoutComponent. In almost all cases, you should subclass CKCompositeComponent instead of subclassing any other class directly.
For example, suppose you create a component that should lay out some children in a vertical stack.
Incorrect: subclass CKStackLayoutComponent and call self newWithChildren:
.
Correct: subclass CKCompositeComponent and call super newWithComponent:[CKStackLayoutComponent newWithChildren...
This hides your layout implementation details from the outside world.
Warning: Overriding -layoutThatFits:parentSize: or -computeLayoutThatFits: is not allowed for any subclass.
+ newWithComponent:
Calls the initializer with {} for view.
+ (instancetype)newWithComponent:(CKComponent *)component
Declared In
CKCompositeComponent.h
+ newWithView:component:
Passed to CKComponent’s initializer. This should be used sparingly for CKCompositeComponent. Prefer delegating view configuration completely to the child component to hide implementation details.
+ (instancetype)newWithView:(const CKComponentViewConfiguration &)view component:(CKComponent *)component
Parameters
view |
Passed to CKComponent’s initializer. This should be used sparingly for CKCompositeComponent. Prefer delegating view configuration completely to the child component to hide implementation details. |
---|---|
component |
The component the composite component uses for layout and sizing. |
Declared In
CKCompositeComponent.h