Skip to content

Commit

Permalink
chore: swiftui not supported for recording (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Mar 25, 2024
1 parent 4d99d72 commit 30d1eb7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions PostHog/Replay/PostHogReplayIntegration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
#if os(iOS)
import Foundation
import SwiftUI
import UIKit
import WebKit

Expand Down Expand Up @@ -213,8 +214,20 @@
return
}

if let controller = window.rootViewController {
if controller is AnyObjectUIHostingViewController {
hedgeLog("SwiftUI snapshot not supported.")
return
}
}

// TODO: offload conversion to off main thread
generateSnapshot(window)
}
}

private protocol AnyObjectUIHostingViewController: AnyObject {}

extension UIHostingController: AnyObjectUIHostingViewController {}

#endif

0 comments on commit 30d1eb7

Please sign in to comment.