-
Notifications
You must be signed in to change notification settings - Fork 1
Add SwiftUI debugger blog #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9878afb to
3b50539
Compare
3b50539 to
791a630
Compare
| | :--------------------------------------------------------------------------------------------------------------------------------------------------------: | | ||
| | [_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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.