88 *
99 */
1010
11+ #import < Foundation/Foundation.h>
1112#import < ComponentKit/CKDefines.h>
12-
13- #if CK_NOT_SWIFT
14-
1513#import < ComponentKit/CKComponent.h>
1614
1715NS_ASSUME_NONNULL_BEGIN
@@ -29,8 +27,17 @@ NS_ASSUME_NONNULL_BEGIN
2927
3028 @warning Overriding -layoutThatFits:parentSize: or -computeLayoutThatFits: is **not allowed** for any subclass.
3129 */
30+ NS_SWIFT_NAME (CompositeComponent)
3231@interface CKCompositeComponent : CKComponent
3332
33+ - (instancetype )init NS_UNAVAILABLE;
34+ - (instancetype _Nullable)initWithComponent:(NS_RELEASES_ARGUMENT CKComponent *_Nullable)component CK_OBJC_UNAVAILABLE;
35+
36+ #if CK_NOT_SWIFT
37+
38+ - (instancetype _Nullable)initWithView:(const CKComponentViewConfiguration &)view
39+ component:(NS_RELEASES_ARGUMENT CKComponent * _Nullable)component CK_SWIFT_DESIGNATED_INITIALIZER;
40+
3441/* * Calls the initializer with {} for view. */
3542+ (instancetype _Nullable)newWithComponent:(NS_RELEASES_ARGUMENT CKComponent * _Nullable)component;
3643
@@ -41,18 +48,20 @@ NS_ASSUME_NONNULL_BEGIN
4148 */
4249+ (instancetype _Nullable)newWithView:(const CKComponentViewConfiguration &)view component:(NS_RELEASES_ARGUMENT CKComponent * _Nullable)component;
4350
44- /* * Access the child component. For intenral use only. */
45- - (CKComponent * _Nullable)child ;
51+ CK_COMPONENT_INIT_UNAVAILABLE;
52+
53+ #endif
54+
55+ /* * Access the child component. For internal use only. */
56+ @property (nonatomic, strong, readonly, nullable) CKComponent *child;
57+
4658
4759@end
4860
4961#define CK_COMPOSITE_COMPONENT_INIT_UNAVAILABLE \
50- CK_COMPONENT_INIT_UNAVAILABLE; \
5162+ (instancetype _Nullable)newWithComponent:(NS_RELEASES_ARGUMENT CKComponent * _Nullable)component NS_UNAVAILABLE; \
5263+ (instancetype _Nullable)newWithView:(const CKComponentViewConfiguration &)view component:(NS_RELEASES_ARGUMENT CKComponent * _Nullable)component NS_UNAVAILABLE
5364
5465NS_ASSUME_NONNULL_END
5566
5667#import < ComponentKit/CompositeComponentBuilder.h>
57-
58- #endif
0 commit comments