Skip to content

Commit e66494c

Browse files
fix(apple): SentrySDK.span (#3958)
The code sample for retrieving the current span was wrong. Instead of SentrySDK.span it stated SentrySDK.getSpan(), which doesn't exist in the SDK. This is fixed now.
1 parent 4e44d9d commit e66494c

File tree

1 file changed

+3
-3
lines changed
  • src/includes/performance/retrieve-transaction

1 file changed

+3
-3
lines changed

src/includes/performance/retrieve-transaction/apple.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Retrieve a Transaction
22

3-
In cases where you want to attach Spans to an already ongoing Transaction you can use `Sentry#GetSpan`. This method will return a `SpanProtocol` in case there is a running Transaction or a `Span` in case there is already a running Span, otherwise it returns `nil`.
3+
In cases where you want to attach Spans to an already ongoing Transaction you can use `Sentry.span`. This method will return a `SpanProtocol` in case there is a running Transaction or a `Span` in case there is already a running Span, otherwise it returns `nil`.
44

55
```swift {tabTitle:Swift}
66
import Sentry
77

8-
var span = SentrySDK.getSpan()
8+
var span = SentrySDK.span
99

1010
if span == nil {
1111
span = SentrySDK.startTransaction(name: "task", operation: "op")
@@ -17,7 +17,7 @@ if span == nil {
1717
```objc {tabTitle:Objective-C}
1818
@import Sentry;
1919

20-
id<Span> span = [SentrySDK getSpan];
20+
id<Span> span = SentrySDK.span;
2121

2222
if (span == nil) {
2323
span = [SentrySDK startTransactionWithName:@"task" operation:@"op"];

0 commit comments

Comments
 (0)