From 4e9196d43398e487be4c029d8ce326224d231722 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 4 Apr 2024 08:36:58 -0700 Subject: [PATCH] Fix RCTRCTComposedViewRegistry for Old Arch by adding count and keyEnumerator (#43850) Summary: In the Old Architecture and for Swift Libraries, these two methods are used to initialize a new disctionary but their implementation was missing so some libraries like lottie were failig to build. ## Changelog: [Internal] - Implement missing `count` and `keyEnumerator` methods for RCTComposedViewRegistry Pull Request resolved: https://github.com/facebook/react-native/pull/43850 Test Plan: Tested locally with the repro provided by SWM Reviewed By: javache Differential Revision: D55743648 Pulled By: cipolleschi fbshipit-source-id: 7bdb92625341cd704b8b09920ab3223a2ca61a54 --- packages/react-native/React/Modules/RCTUIManager.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-native/React/Modules/RCTUIManager.m b/packages/react-native/React/Modules/RCTUIManager.m index f5e5c7c7a82aca..04e223b94242d2 100644 --- a/packages/react-native/React/Modules/RCTUIManager.m +++ b/packages/react-native/React/Modules/RCTUIManager.m @@ -1680,6 +1680,16 @@ - (instancetype)initWithUIManager:(RCTUIManager *)uiManager andRegistry:(NSDicti return self; } +- (NSUInteger)count +{ + return self->_registry.count; +} + +- (NSEnumerator *)keyEnumerator +{ + return self->_registry.keyEnumerator; +} + - (id)objectForKey:(id)key { if (![key isKindOfClass:[NSNumber class]]) {