diff --git a/Examples/Examples/ExamplesApp.swift b/Examples/Examples/ExamplesApp.swift index 8467a29..9a369e8 100644 --- a/Examples/Examples/ExamplesApp.swift +++ b/Examples/Examples/ExamplesApp.swift @@ -26,3 +26,8 @@ class ItemsModel { return lastItem } } + +#Preview { + let model = ItemsModel() + Text(model.lastItem?.description ?? "No last item") +} diff --git a/Sources/IssueReporting/IssueReporters/RuntimeWarningReporter.swift b/Sources/IssueReporting/IssueReporters/RuntimeWarningReporter.swift index 9d95dda..e13aa2a 100644 --- a/Sources/IssueReporting/IssueReporters/RuntimeWarningReporter.swift +++ b/Sources/IssueReporting/IssueReporters/RuntimeWarningReporter.swift @@ -66,6 +66,11 @@ public struct _RuntimeWarningReporter: IssueReporter { column: UInt ) { #if canImport(os) + guard ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] != "1" + else { + print("🟣 \(fileID):\(line): \(message() ?? "")") + return + } let moduleName = String( Substring("\(fileID)".utf8.prefix(while: { $0 != UTF8.CodeUnit(ascii: "/") })) )