We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e64d3d4 commit b13e93aCopy full SHA for b13e93a
Samples/SentrySampleShared/SentrySampleShared/UIViewControllerExtension.swift
@@ -6,7 +6,12 @@ import UIKit
6
7
public extension UIViewController {
8
func createTransactionObserver(forCallback: @escaping (Span) -> Void) -> SpanObserver? {
9
- let result = SpanObserver(callback: forCallback)
+ let result = SpanObserver { span in
10
+ // This callback may not be on the main queue, but `forCallback` is always called on the main queue.
11
+ DispatchQueue.main.async {
12
+ forCallback(span)
13
+ }
14
15
if result == nil {
16
UIAssert.fail("Transaction was not created")
17
}
0 commit comments