Change CK Construction

Summary: The sample iOS project can't be built by `buck` because the internal(?) reference codes aren't available anymore. This diff change the way to instantiate the components and add CK dependency (not sure if the correct one or not).

Reviewed By: passy

Differential Revision: D24782764

fbshipit-source-id: 809245771fc3b542fe63dfccdc8bbc6913aa63af
This commit is contained in:
Chaiwat Ekkaewnumchai
2020-11-09 23:26:06 -08:00
committed by Facebook GitHub Bot
parent dce7422ba6
commit 307fc18916

View File

@@ -55,37 +55,28 @@
static CKComponent* componentForModel( static CKComponent* componentForModel(
id<NSObject> model, id<NSObject> model,
id<NSObject> context) { id<NSObject> context) {
return [CKBackgroundLayoutComponent return CK::BackgroundLayoutComponentBuilder()
newWithComponent: .component(CK::FlexboxComponentBuilder()
[CKFlexboxComponent newWithView:{} .child({.component = CK::ButtonComponentBuilder()
size:{} .action(nil)
style:{} .title(@"Purple")
children:{ .titleColor(UIColor.purpleColor)
{[CKButtonComponent .build()})
newWithAction:nil .child({.component = CK::ButtonComponentBuilder()
options:{ .action(nil)
.titles = @"Purple", .title(@"Brown")
.titleColors = .titleColor(UIColor.brownColor)
UIColor.purpleColor, .build()})
}]}, .child({.component = CK::ButtonComponentBuilder()
{[CKButtonComponent .action(nil)
newWithAction:nil .title(@"Cyan")
options:{ .titleColor(UIColor.cyanColor)
.titles = @"Brown", .build()})
.titleColors = .build())
UIColor.brownColor, .background(CK::ImageComponentBuilder()
}]}, .image([UIImage imageNamed:@"sonarpattern"])
{[CKButtonComponent .build())
newWithAction:nil .build();
options:{
.titles = @"Cyan",
.titleColors =
UIColor.cyanColor,
}]},
}]
background:CK::ImageComponentBuilder()
.image([UIImage imageNamed:@"sonarpattern"])
.build()];
} }
@end @end