Skip to content

Conversation

@noahsmartin
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-engineering Ready Ready Preview, Comment Jan 20, 2026 8:49pm

Request Review

| :--------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [_UIKit automatic tracing_](https://docs.sentry.io/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#uiviewcontroller-tracing) |

This works using Objective-C swizzling, replacing the instance methods with stubs that add logging and then call the original method. This mechanism is possible because the Objective-C runtime uses selectors to identify methods and call them through `objc_msgSend()`. It would be very useful if we could do something similar for SwiftUI. For example, our [snapshot test framework](https://github.com/EmergeTools/SnapshotPreviews) (from my work at Emerge Tools, now part of Sentry) could report the slowest views. However, Swift does not need to use this mechanism. Swift function calls can even be optimized away entirely by the compiler through inlining, so we can't use swizzling to hook a pure Swift function.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"could report the slowest views" - feels a bit off to just say this w/ no links out (don't think we ever publicized this). If there's nothing to link to, we can leave it at that, but if you do have something would be nice to have

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear that is not something we do, it's just something we could do with this framework. So I don't think there is a link for it

@noahsmartin noahsmartin merged commit b1d8b23 into main Jan 20, 2026
8 checks passed
@noahsmartin noahsmartin deleted the debuggerBlog branch January 20, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants