Skip to content

Commit

Permalink
feat(apple): Explain UIViewController scope logic (#11816)
Browse files Browse the repository at this point in the history
Explain how the SDK decides on the parent-child relationship for
UIViewController transactions and which UIViewController transactions to
put on the scope.

Co-authored-by: Liza Mock <[email protected]>
  • Loading branch information
philipphofmann and lizokm authored Nov 15, 2024
1 parent cbb35e4 commit b94f509
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ The SDK creates spans to provide insight into the time consumed by each of the m

![`UIViewController` Transaction](./img/ui-view-controller-transaction.png)

### Nested View Controllers

The SDK sets up a parent-child relationship for nested UIViewControllers, starting with the first UIViewController that your app loads. If there's no active transaction on the scope, the SDK will start a new UIViewController transaction and bind it to the scope unless there's a [user interaction](#user-interaction-tracing) transaction already on the scope, in which case this will be closed and removed first.

While a UIViewController transaction is active on the scope, the SDK will add any new UIViewController spans as child spans of that active transaction. This creates a unified view of all UIViewControllers on a screen in a single transaction.

If another transaction is already bound to the scope (if it's been set manually, for example) the SDK won't be able to bind a new UIViewController transaction to the scope. This means that the new transaction will work, but won’t capture other auto-generated spans, like HTTP, file IO, or Core Data, which can only be added to transactions that are bound to the scope.

To disable the `UIViewController` Tracing:


Expand Down

0 comments on commit b94f509

Please sign in to comment.