feat: implement ios part of measureOnUI#163
Merged
WoLewicki merged 3 commits into0.81.4-discordfrom Apr 17, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Implements the iOS/Fabric plumbing for measureOnUI, allowing JS-driven measurement to be performed against the native view hierarchy (similar to Android), via the Scheduler → SurfacePresenter → MountingManager path.
Changes:
- Implement
-[RCTSurfacePresenter schedulerMeasure:jsCallback:]to forward measure requests onto the main thread and into the mounting layer. - Add
-[RCTMountingManager measureAsyncOnUI:rootView:callback:]to computex, y, width, height, pageX, pageYfrom UIKit views. - Expose the new MountingManager API in
RCTMountingManager.h.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/react-native/React/Fabric/RCTSurfacePresenter.mm | Forwards scheduler “measure on UI” requests to the mounting manager on the main queue. |
| packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm | Adds UIKit-based measurement implementation and invokes provided callback with results. |
| packages/react-native/React/Fabric/Mounting/RCTMountingManager.h | Declares the new async UI measurement method. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+353
to
+354
| RCTLogWarn(@"measure cannot find view with tag #%d", reactTag); | ||
| callback({}); |
|
|
||
| UIView<RCTComponentViewProtocol> *view = [self->_componentViewRegistry findComponentViewWithTag:reactTag]; | ||
| if (!view) { | ||
| RCTLogWarn(@"measure cannot find view with tag #%d", reactTag); |
Comment on lines
+356
to
+360
| RCTFabricSurface *surface = [self surfaceForRootTag:surfaceId]; | ||
|
|
||
| std::function<void(folly::dynamic)> callbackCopy = jsCallback; | ||
| RCTExecuteOnMainQueue(^{ | ||
| UIView *rootView = surface.view; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR implementing iOS part of measuring pressables on UI with native views, taken mostly from facebook#51835