Follow-up: SwiftUI limitations for Mobile Analytics
Stopgap solution by Dynatrace

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸
Search for a command to run...
Stopgap solution by Dynatrace

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸
No comments yet. Be the first to comment.
WWDC26 kicked off on June 8, 2026. The information in this article reflects the information published by Apple on that date. There are 14 new frameworks. Name Description AccessoryAccess Manage

WWDC25 kicked off on June 9, 2025. The information in this article reflects the information published by Apple on that date. New Frameworks NameDescription AlarmKitSchedule prominent alarms and countdowns to help people manage their time. AVR...

WWDC25 is almost here, and I couldn’t be more excited! Whether you're attending the official events, community meetups, or just soaking in the energy around Cupertino, there’s no better time to connect, share ideas, and celebrate everything we love a...

In this blog post, I’ll share an observation and advice regarding the caching behavior of network responses by Apple’s APIs. If you are unfamiliar with caching of network responses then I recommend Apple’s article Accessing cached data that introduce...
WWDC24 kicked off on June 10, 2024. The information in this article reflects the information published by Apple on that date. New Frameworks NameDescription AccessorySetupKitUse AccessorySetupKit to discover accessories with Bluetooth or Wi-Fi...

This is a follow-up to a previous blog post of mine. I explained how Mobile Analytics providers could not automatically capture user interactions and presented screens unless the controls were implemented in UIKit.
Consequently, you are forced to manually instrument your code with APIs provided by the Analytics provider of your choice.
If you use Dynatrace and you may benefit from their interesting approach to spare app developers from this tedious work.
Dynatrace provides a command-line tool, the so-called "SwiftUI instrumentor", that adjusts your Xcode project. This allows adding the necessary code to your project's source code (*.swift files) during the build process.
There are other tools or Swift build plugins that also change source code. This is usually transparent, and you would commit those changes as part of your source control management. The big difference is that the Dynatrace tool reverts the changes at the end of the build phase. Your code looks unchanged, but the build artifact contains the changes. Imo this is a bold move to change the original application code during build time in such a way. To check the difference between your original code and the code modified by the SwiftUI instrumentor, you can a command that produces a diff.
For this particular case, there are also some limitations, e.g. issues with SwiftUI previews and longer build times. And finally, Dynatrace doesn't support the instrumentation of custom SwiftUI controls. For the list of SwiftUI controls you can instrument, see their list of Supported controls.
I am not using and I am not promoting Dynatrace. I was merely fascinated by their initiative to provide such tooling that has challenges and costs for Dynatrace. But the company is willing to invest in a stopgap solution to ease the implementation efforts of their customers.