# Mobile app support for swiftui?

**URL:** <https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344>\
**Category:** Open Q&A\
**Tags:** ios, dynatrace-mobile-app\
**Created:** [May 15, 2020, 2:41pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344 "2020-05-15T14:41:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anders\_lundin3](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/anders_lundin3/32/39823_2.png) [@anders\_lundin3](https://community.dynatrace.com/u/anders_lundin3)\
**Post date:** [May 15, 2020, 2:41pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/1 "2020-05-15T14:41:50Z")

</div>

We want to instrument a iOS mobile application buil on SwiftUI. Will this work nicely with Dynatrace mobile app SDK?

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [May 15, 2020, 3:17pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/2 "2020-05-15T15:17:27Z")

</div>

Can find only a bit on this internally but it looks like it’s not something that we will auto-instrument at least not at this time. But since it’s just Swift I see no reason you couldn’t manually instrument it using the iOS OneAgent SDK.

> **[OneAgent SDK for iOS in RUM Classic](https://docs.dynatrace.com/docs/observe/digital-experience/rum-classic/mobile-applications/instrument-ios-app/customization/oneagent-sdk-for-ios)**
>
> Enrich mobile user experience monitoring using OneAgent SDK for iOS.

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [May 18, 2020, 5:59am UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/3 "2020-05-18T05:59:58Z")

</div>

I can confirm that pure SwiftUI is not yet supported, auto-instrumentation will not work for most UI elements and needs to be performed manually. Webrequest instrumentation will still work, but automatic linking to lifecycle action will not work for pure SwiftUI apps. In some scenarios automatic linking to manual actions might work. The SDK for manual instrumentation will work.

---

<div class="post-metadata">

**Author:** ![anders\_lundin3](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/anders_lundin3/32/39823_2.png) [@anders\_lundin3](https://community.dynatrace.com/u/anders_lundin3)\
**Post date:** [May 19, 2020, 6:24am UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/4 "2020-05-19T06:24:36Z")

</div>

Thanks for your input!

---

<div class="post-metadata">

**Author:** ![paul\_kapeller](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/paul_kapeller/32/37806_2.png) [@paul\_kapeller](https://community.dynatrace.com/u/paul_kapeller)\
**Post date:** [September 7, 2022, 2:21pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/5 "2022-09-07T14:21:02Z")

</div>

With the latest release of the iOS agent (8.249) we have implemented auto-instrumentation of SwiftUI. Further improvements are on the way.  
For more info please visit the [documentation](https://www.dynatrace.com/support/help/how-to-use-dynatrace/real-user-monitoring/setup-and-configuration/mobile-apps/instrument-ios-app/instrumentation/instrument-swiftui-controls).

---

<div class="post-metadata">

**Author:** ![marcelodesouza](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@marcelodesouza](https://community.dynatrace.com/u/marcelodesouza)\
**Post date:** [July 14, 2025, 2:21pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/6 "2025-07-14T14:21:02Z")

</div>

Hi,

I am trying to&nbsp;override the captured control titles. I saw on the documentation the properties&nbsp;dtxCustomControlName, dtxCustomCellName and dtxCustomCellName.

Is there anything for SwiftUI?

I want to display something better than “Touch on CollectionViewCell @0:1” for example.  
Thanks

---

<div class="post-metadata">

**Author:** ![paul\_kapeller](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/paul_kapeller/32/37806_2.png) [@paul\_kapeller](https://community.dynatrace.com/u/paul_kapeller)\
**Post date:** [July 14, 2025, 2:51pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/7 "2025-07-14T14:51:01Z")

</div>

Did you check our documentation in that regard? Is there any specific feature missing that you’re looking after?&nbsp;[https://docs.dynatrace.com/docs/observe/digital-experience/mobile-applications/instrument-ios-app/instrumentation/instrument-swiftui-controls#swiftui-control-labels](https://docs.dynatrace.com/docs/observe/digital-experience/mobile-applications/instrument-ios-app/instrumentation/instrument-swiftui-controls#swiftui-control-labels)

---

<div class="post-metadata">

**Author:** ![marcelodesouza](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@marcelodesouza](https://community.dynatrace.com/u/marcelodesouza)\
**Post date:** [July 14, 2025, 3:04pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/8 "2025-07-14T15:04:20Z")

</div>

I did check this documentation before. I saw the option:

```python
Button("Login", action: {
/* perform login */
}).withCustomInstrumentationConfig(.useControlName("Login Button"))

```

But when I try to use&nbsp; **useControlName** , it says that is has not member with this name.

I checked the&nbsp;SwiftUIInstrumentationConfigParam and I only found those three options:&nbsp; **skipInstrumentation** , **useDefaultControlName** , **doNotReportStateVariable**

How do I set my own control name?

Thanks

---

<div class="post-metadata">

**Author:** ![irina\_galata](https://avatars.discourse-cdn.com/v4/letter/i/ce73a5/32.png) [@irina\_galata](https://community.dynatrace.com/u/irina_galata)\
**Post date:** [July 14, 2025, 3:59pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/9 "2025-07-14T15:59:27Z")

</div>

The **useControlName** property was introduced in the **8.317** release of the iOS agent. This will work for most of the instrumented controls, such as buttons, toggles, pickers, sliders, etc.

However, in your case,&nbsp;“Touch on CollectionViewCell @0:1” is an action that is generated by the UIKit instrumentation of **UICollectionView** , which exists under the hood when you create a SwiftUI List. Currently, this naming can’t be modified.

---

<div class="post-metadata">

**Author:** ![marcelodesouza](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@marcelodesouza](https://community.dynatrace.com/u/marcelodesouza)\
**Post date:** [July 14, 2025, 5:40pm UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/10 "2025-07-14T17:40:04Z")

</div>

Is it a limitation from SwiftUI? Or is something that I can expect support from Dynatrace in the future? Thanks

---

<div class="post-metadata">

**Author:** ![irina\_galata](https://avatars.discourse-cdn.com/v4/letter/i/ce73a5/32.png) [@irina\_galata](https://community.dynatrace.com/u/irina_galata)\
**Post date:** [July 15, 2025, 5:51am UTC](https://community.dynatrace.com/t/mobile-app-support-for-swiftui/19344/11 "2025-07-15T05:51:46Z")

</div>

Generally, we’re much more limited in terms of instrumentation when it comes to SwiftUI due to its declarative nature. Currently, we can detect a SwiftUI list interaction when either its **selection** property changes or it contains navigation links (declared as **NavigationLink** or **navigationDestination** view modifier).  
In all other cases, the instrumentation is handled by the iOS agent and not the SwiftUI instrumentor via the **UICollectionView** , and customising UIKit behavior from SwiftUI code is more complex.&nbsp;  
We do, however, regularly reevaluate different approaches, and we may improve support in the future.
