diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index 2db1bc9419..8bc31ee03e 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -240,6 +240,10 @@ RCT_EXPORT_MODULE() - (void)didReceiveNewContentSizeMultiplier { + // Report the event across the bridge. + [_bridge.eventDispatcher sendDeviceEventWithName:@"didUpdateContentSizeMultiplier" + body:@([_bridge.accessibilityManager multiplier])]; + dispatch_async(RCTGetUIManagerQueue(), ^{ [[NSNotificationCenter defaultCenter] postNotificationName:RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification object:self]; @@ -1565,6 +1569,11 @@ RCT_EXPORT_METHOD(configureNextLayoutAnimation:(NSDictionary *)config }]; } +RCT_EXPORT_METHOD(getContentSizeMultiplier:(nonnull RCTResponseSenderBlock)callback) +{ + callback(@[@(_bridge.accessibilityManager.multiplier)]); +} + - (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(UIView *view))completion { RCTAssertMainQueue();