You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a component which will be used in a collectionview. This component in turn can be built up with many other components so I have a CKStackLayoutComponent which I want to insert multiple children. The number of children will be dynamic (in reality no more than 4), what is the best way to build these up and pass to the children of a CKStackLayoutComponent?
The text was updated successfully, but these errors were encountered:
The best way to add a dynamic number of children is to build up a std::vector of CKStackLayoutComponentChild using methods like push_back.
std::vector<CKStackLayoutComponentChild> children = {};
for (ModelType *model in models) {
// Create component from model, let's say the name of the component you create is childComponent.
children.push_back(childComponent);
}
And then you can pass in the children directly to CKStackLayoutComponent.
If you already know the exact number beforehand, I would suggest you just create the children inline with CKStackLayoutComponent.
I have a component which will be used in a collectionview. This component in turn can be built up with many other components so I have a CKStackLayoutComponent which I want to insert multiple children. The number of children will be dynamic (in reality no more than 4), what is the best way to build these up and pass to the children of a CKStackLayoutComponent?
The text was updated successfully, but these errors were encountered: