in ComponentKit/Core/ComponentBuilder.h [951:995]
class __attribute__((__may_alias__)) ComponentBuilder : public ComponentBuilderBase<ComponentBuilder, PropsBitmap> {
public:
~ComponentBuilder() = default;
private:
ComponentBuilder() = default;
ComponentBuilder(const CK::ComponentSpecContext& context)
: ComponentBuilderBase<ComponentBuilder, PropsBitmap>{context} { }
friend auto CK::ComponentBuilder() -> ComponentBuilderEmpty;
friend auto CK::ComponentBuilder(const CK::ComponentSpecContext&) -> ComponentBuilderContext;
template <template <PropsBitmapType> class, PropsBitmapType>
friend class BuilderBase;
/**
Creates a new component instance with specified properties.
@note This method must @b not be called more than once on a given component builder instance.
*/
NS_RETURNS_RETAINED auto _build() noexcept -> CKComponent *
{
if (PropBitmap::isSet(PropsBitmap, ViewConfigBuilderPropId::viewConfig, ComponentBuilderBasePropId::size)) {
return [CKComponent newWithView:this->_viewConfig size:this->_size];
} else if (PropBitmap::isSet(PropsBitmap, ViewConfigBuilderPropId::viewClass, ComponentBuilderBasePropId::size)) {
return [CKComponent newWithView:{std::move(this->_viewClass),
std::move(this->_attributes),
std::move(this->_accessibilityCtx),
this->_blockImplicitAnimations}
size:this->_size];
} else if (PropBitmap::isSet(PropsBitmap, ViewConfigBuilderPropId::viewConfig)) {
return [CKComponent newWithView:this->_viewConfig size:{}];
} else if (PropBitmap::isSet(PropsBitmap, ViewConfigBuilderPropId::viewClass)) {
return [CKComponent newWithView:{std::move(this->_viewClass),
std::move(this->_attributes),
std::move(this->_accessibilityCtx),
this->_blockImplicitAnimations}
size:{}];
} else if (PropBitmap::isSet(PropsBitmap, ComponentBuilderBasePropId::size)) {
return [CKComponent newWithView:{} size:this->_size];
} else {
return [CKComponent new];
}
}
};