You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/apple/common/tracing/instrumentation/automatic-instrumentation.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -447,12 +447,6 @@ When the user interaction transaction is not finished yet, but the user makes a
447
447
448
448
## Time to Initial Display
449
449
450
-
<Alert>
451
-
452
-
This feature only works for UIViewControllers and not for SwiftUI.
453
-
454
-
</Alert>
455
-
456
450
By adding a span for a view controller when it's loaded, time to initial display (TTID) provides insight into how long it takes for your view controller to launch and draw its first UI frame. The SDK sets the span operation to `ui.load.initial-display` and the span description to the view controller's name, followed by `initial display` - for example, `MainViewController initial display`.
457
451
458
452
The span starts when the view of a view controller is loaded, and there is no other view controller transaction happening at the moment. The span finishes after the view appeared on the screen. The following chart shows how time to initial display (TTID) and [time to full display (TTFD)](#time-to-full-display) correlate to transitions between activities:
@@ -461,18 +455,24 @@ The span starts when the view of a view controller is loaded, and there is no ot
461
455
462
456
Since Cocoa SDK version 8.33.0, the SDK doesn't create time to initial display (TTID) and [time to full display (TTFD)](#time-to-full-display) spans for UIViewControllers presented in the background because the logic requires UI frames to be drawn.
463
457
464
-
## Time to Full Display
465
-
466
458
<Alert>
467
459
468
-
This feature only works for UIViewControllers and not for SwiftUI.
460
+
For SwiftUI views, see the [SwiftUI Instrumentation documentation](/platforms/apple/common/tracing/instrumentation/swiftui-instrumentation/#time-to-initial-display-and-time-to-full-display)for TTID and TTFD tracking.
469
461
470
462
</Alert>
471
463
472
-
By adding a span for a view controller when it's loaded, time to full display (TTFD) provides insight into how long it takes your view controller to launch and load all of its content. The span starts when the view of a view controller is loaded, and there is no other view controller transaction happening at the moment. The SDK sets the span operation to `ui.load.full-display` and the span description to the view controllers' name, followed by `full display` - for example, `MainActivity full display`.
464
+
## Time to Full Display
465
+
466
+
By adding a span for a view controller when it's loaded, time to full display (TTFD) provides insight into how long it takes your view controller to launch and load all of its content. The span starts when the view of a view controller is loaded, and there is no other view controller transaction happening at the moment. The SDK sets the span operation to `ui.load.full-display` and the span description to the view controllers' name, followed by `full display` - for example, `MainViewController full display`.
473
467
474
468
Since Cocoa SDK version 8.33.0, the SDK doesn't create [time to initial display (TTID)](#time-to-initial-display) and time to full display (TTFD) spans for UIViewControllers presented in the background, because the logic requires UI frames to be drawn.
475
469
470
+
<Alert>
471
+
472
+
For SwiftUI views, see the [SwiftUI Instrumentation documentation](/platforms/apple/common/tracing/instrumentation/swiftui-instrumentation/#time-to-initial-display-and-time-to-full-display) for TTID and TTFD tracking.
473
+
474
+
</Alert>
475
+
476
476
_Time to full display is disabled by default, but you can enable it by setting:_
Copy file name to clipboardExpand all lines: docs/platforms/apple/common/tracing/instrumentation/swiftui-instrumentation.mdx
+114Lines changed: 114 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,3 +80,117 @@ var body: some View {
80
80
This is the result
81
81
82
82

83
+
84
+
## Time to Initial Display and Time to Full Display
85
+
86
+
<Alert>
87
+
88
+
This feature is available since version 8.44.0 and only works for iOS and tvOS.
89
+
90
+
</Alert>
91
+
92
+
You can track time to initial display (TTID) and time to full display (TTFD) for your SwiftUI views to measure how long it takes for screens to render their first frame and then fully load all content.
93
+
94
+
-**Time to initial display (TTID)**: Automatically tracked when the view appears on screen. The SDK sets the span operation to `ui.load.initial-display` and the span description to the view name followed by `initial display` - for example, `Content View Body initial display`.
95
+
96
+
-**Time to full display (TTFD)**: Requires enabling with the `waitForFullDisplay` parameter and manually calling `SentrySDK.reportFullyDisplayed()` when your view has finished loading all content. The SDK sets the span operation to `ui.load.full-display` and the span description to the view name followed by `full display` - for example, `Content View Body full display`.
97
+
98
+
### Enabling Time to Full Display
99
+
100
+
To enable TTFD tracking, set `waitForFullDisplay: true` when creating a `SentryTracedView`:
If you don't specify `waitForFullDisplay`, the SDK will use the value from the `enableTimeToFullDisplayTracing` option. You can enable TTFD globally for all views by setting this option:
140
+
141
+
```swift {tabTitle:Swift}
142
+
143
+
importSentry
144
+
145
+
SentrySDK.start { options in
146
+
options.dsn="___PUBLIC_DSN___"
147
+
options.enableTimeToFullDisplayTracing=true
148
+
}
149
+
```
150
+
151
+
### When to Call reportFullyDisplayed()
152
+
153
+
Call `SentrySDK.reportFullyDisplayed()` when your view has finished loading all of its content, including any asynchronous operations like:
154
+
155
+
- Network requests to fetch data
156
+
- Image loading
157
+
- Database queries
158
+
- Any other async operations that affect the view's content
159
+
160
+
Typically, you'll call this in the `onAppear` modifier after your async content has loaded:
-**Nested views**: The `waitForFullDisplay` parameter is ignored for nested `SentryTracedView` instances. Only the root transaction (the outermost `SentryTracedView`) will track TTID and TTFD spans.
191
+
192
+
-**30-second timeout**: If `reportFullyDisplayed()` is not called within 30 seconds, the TTFD span will automatically finish with `SpanStatus.DEADLINE_EXCEEDED`. The duration will match the TTID span duration, and the description will contain a `Deadline Exceeded` suffix.
193
+
194
+
-**Early calls**: If `reportFullyDisplayed()` is called before the view appears, the reported time will be shifted to match the TTID measured time.
195
+
196
+
For more information about TTID and TTFD metrics, see the [Mobile Vitals documentation](/product/insights/mobile/mobile-vitals/#time-to-initial-display-and-time-to-full-display).
Copy file name to clipboardExpand all lines: docs/product/insights/mobile/mobile-vitals/screen-loads.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,8 @@ Sentry tracks TTID automatically, but [TTFD](/product/insights/mobile/mobile-vit
25
25
**For iOS:**
26
26
27
27
-`>=7.12.0` for UIViewController transactions
28
-
-`>=8.4.0` for [TTID](/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#time-to-initial-display)+[TTFD](/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#time-to-full-display)
28
+
-`>=8.4.0` for [TTID](/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#time-to-initial-display)+[TTFD](/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#time-to-full-display) for UIViewController
29
+
-`>=8.44.0` for [TTID+TTFD for SwiftUI](/platforms/apple/common/tracing/instrumentation/swiftui-instrumentation/#time-to-initial-display-and-time-to-full-display)
0 commit comments