Skip to content

Instantly share code, notes, and snippets.

@okwasniewski
Created February 26, 2025 12:04
Show Gist options
  • Save okwasniewski/ce4c4ef2857673fc7bd13a892c06158a to your computer and use it in GitHub Desktop.
Save okwasniewski/ce4c4ef2857673fc7bd13a892c06158a to your computer and use it in GitHub Desktop.
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
{
const auto &oldViewProps = *std::static_pointer_cast<SwiftUIStoreViewViewProps const>(_props);
const auto &newViewProps = *std::static_pointer_cast<SwiftUIStoreViewViewProps const>(props);
if (oldViewProps.productIDs != newViewProps.productIDs) {
NSMutableArray *productIds = [[NSMutableArray alloc] initWithCapacity:newViewProps.productIDs.size()];
for (auto &productId : newViewProps.productIDs) {
[productIds addObject:[NSString stringWithUTF8String:productId.c_str()]];
}
_view.productIDs = productIds;
}
[super updateProps:props oldProps:oldProps];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment