App performance for iOS

  • Latest Dynatrace
  • Explanation
  • Published Dec 19, 2025

App performance monitoring provides insight into how an iOS app is experienced on screen. This includes how long the app takes to become ready, which screens are shown, and how users move between them.

OneAgent for iOS tracks this flow from the initial App Start up to in-app navigations between views, until the app is backgrounded or terminated.

OneAgent for iOS captures the following concepts and stores them as events in Grail:

  • App Start events—measure app startup and foreground transitions.
  • Views—represent user-visible screens.
  • Navigation events—represent transitions between screens and state changes (for example, app start and app going to background).
  • View summaries—aggregated events created when a view ends, summarizing what happened while the view was visible.

These concepts follow the general mobile RUM model described in Mobile RUM Concepts. For definitions, see Application start, Views and view summaries, and Navigations.

Each event consists of well-defined key-value fields as specified in the Semantic Dictionary for user events, including app_start.*, navigation.*, and view.*.

This data can be analyzed in apps such as Experience Vitals and Users & Sessions, or queried directly in Grail using DQL.

OneAgent for iOS captures startup and lifecycle information automatically by registering for iOS lifecycle callbacks (via NotificationCenter and UIKit method swizzling). Based on this information, OneAgent can automatically detect views for UIViewController subclasses.

For SwiftUI applications, the Dynatrace SwiftUI Instrumentor provides build-time instrumentation that automatically captures views when using NavigationLink, navigationDestination, sheet, popover, and other navigation patterns. For custom scenarios not covered by automatic instrumentation, views can be captured manually using Dynatrace.startView(...).

App Start event

The App Start event measures how long it takes for an app to become ready after a startup or foreground transition.

OneAgent classifies app starts into three types: cold, warm, and hot (see Application start for definitions and examples).

On iOS, classification is derived from process and UIApplication lifecycle signals (for example, whether the process was freshly created and whether the device was recently rebooted).

In addition to being available as an app start event, an app start is also represented as a navigation event (a navigation without a source view).

How app start is captured

OneAgent tracks app start based on iOS lifecycle callbacks, capturing a sequence of phases:

  • System initialization—time from process creation to dyld load.
  • Runtime initialization—time from dyld load to UIApplication initialization.
  • UIKit initialization—time from UIApplication init to application(_:didFinishLaunchingWithOptions:).
  • Application initialization—time from didFinishLaunching to UIViewController.loadView.
  • Initial frame rendering—time from loadView to applicationDidBecomeActive.

App start types

OneAgent for iOS distinguishes between three app start types:

TypeDescription
ColdOccurs when the device was rebooted after the last launch, or the app is launched for the first time. The process and all app resources must be fully initialized.
WarmOccurs when the app was previously terminated but the device was not rebooted. Some system caches may still be available.
HotOccurs when the app was already running in the background and is brought to the foreground. The process is resumed rather than created.

Ensure accurate measurement

To capture the full app start duration, measurement must begin as early as possible. For auto-instrumented applications, OneAgent starts measuring by swizzling UIApplication and UIViewController lifecycle methods. If automatic startup is disabled or the agent is started manually, measurement begins only when the agent starts. In this case, calling Dynatrace.startup(...) as early as possible (ideally in application(_:didFinishLaunchingWithOptions:)) ensures accurate results. Otherwise, the reported duration may be shorter than the actual startup time.

A navigation event represents a transition context between views, or a change in the app's visible state (see Navigations).

A navigation can have:

  • Source view—the view that was active before the transition.
  • Current view—the view that becomes active.

In the common case, a navigation acts as a glue event between two views.

Navigations are generated for both automatic view tracking (UIViewController transitions) and manual view tracking (via Dynatrace.startView(...)).

  • App start—a navigation without a source view.
  • Visibility change to background—a navigation with a source view but no current view.

Views

In Dynatrace, a view represents a user-visible screen (see Views and view summaries).

For the field reference, see View attributes.

OneAgent tracks views automatically for UIViewController subclasses. For SwiftUI applications, the Dynatrace SwiftUI Instrumentor enables automatic view tracking for navigation-related components. For other UI components, views can be tracked manually.

Only one view can be active at a time. Starting a new view automatically closes the previous one and triggers a navigation event.

While the app is in the foreground, OneAgent for iOS maintains a current view context. The view name is attached to events captured automatically (for example, web requests) and to events created via the Dynatrace APIs. This provides the screen context in which an event occurred.

Automatic view tracking for UIKit

For UIViewController subclasses, OneAgent captures views based on lifecycle callbacks:

  • A view starts when a UIViewController enters viewDidAppear.
  • A view ends when a UIViewController enters viewDidDisappear.

OneAgent automatically detects view controllers within container controllers:

  • UINavigationController—tracks push and pop operations.
  • UITabBarController—tracks tab selections.
  • UISplitViewController—tracks detail view controller changes.
  • Modal presentations via present(_:animated:completion:) and dismiss(animated:completion:).

Automatic view tracking for SwiftUI

For SwiftUI applications, the Dynatrace SwiftUI Instrumentor provides build-time instrumentation that automatically captures views.

The SwiftUI Instrumentor automatically tracks views for the following navigation patterns:

ComponentDescription
NavigationLinkTracks the destination view when navigating via NavigationLink
navigationDestinationTracks views presented via the navigationDestination(for:destination:) modifier
sheetTracks views presented as modal sheets
popoverTracks views presented as popovers
TabViewTracks tab selections and their associated views
MenuTracks the menu container lifecycle

For more information on setting up the SwiftUI Instrumentor, see SwiftUI Instrumentation.

Track views manually

For UI components that are not auto-detected (such as custom container controllers, embedded content, or SwiftUI views not using the supported navigation patterns), use Dynatrace.startView(...):

Dynatrace.startView(name: "Login")

Calling startView starts a new view and automatically ends the previously active view. All events captured thereafter are evaluated in the context of that view.

Disable automatic view tracking

To disable automatic view tracking and rely solely on manual view instrumentation, set the DTXInstrumentLifecycleMonitoring configuration key to false in your app's Info.plist file:

<key>DTXInstrumentLifecycleMonitoring</key>
<false/>

When automatic view tracking is disabled:

  • Views are only captured when you call Dynatrace.startView(...).
  • Visibility change events are still sent when the app goes to background/foreground.

View summary

When a view ends, OneAgent creates a view summary, an aggregated event summarizing what happened during the view's lifetime (see Views and view summaries). View summaries are reported separately from other events.

What is captured

  • Start time—when the view started.
  • Duration—how long the view was active.
  • Error counts—the number of errors that occurred while the view was active:
    • Total error count.
    • Exception count.
    • HTTP 4xx error count.
    • HTTP 5xx error count.
    • Other HTTP error count.
    • Other request error count.

For the field reference, see View summary.

How it works

While a view is active, OneAgent tracks all events that occur within that view context. When you call Dynatrace.sendHttpRequestEvent(...) or when errors are reported, these are automatically associated with the current view.

When the view ends (either by starting a new view or the app going to background), the view summary is generated and sent to Dynatrace.

Related tags
Digital Experience