.h file
#import "CKCompositeComponent.h"
@interface JWTextComponent : CKCompositeComponent
- (instancetype)newWithText:(NSString *)text;
@end
.mm file
#import "JWTextComponent.h"
@implementation JWTextComponent
- (instancetype)newWithText:(NSString *)text
{
return [super newWithView:{
[UILabel class],
{
{@selector(setText:), text},
}
} size:{}];
}
@end
But I get this error that I can't figure out why
in my Podfile I have simply,
target 'CKTest' do
pod 'ComponentKit', '~> 0.11'
end
target 'CKTestTests' do
end
I tried following the sample project as closely as possible, this seems like the most simple case of creating a CKComponent, but maybe some fundamental error, I can't seem to get it working.
Where is the big white elephant hiding in my blind spot?
Solved:
I didn't have the initialiser as a class initializer.