File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -286,38 +286,6 @@ public struct DependencyValues: Sendable {
286
286
if DependencyValues . isPreparing {
287
287
#if canImport(SwiftUI)
288
288
if context == . preview, Thread . isPreviewAppEntryPoint {
289
- reportIssue (
290
- """
291
- Xcode Previews: Ignoring dependencies prepared in app entry point.
292
-
293
- To silence this warning, use the dependency context to conditionally prepare them:
294
-
295
- import Dependencies
296
- import SwiftUI
297
-
298
- @main
299
- struct MyApp: App {
300
- + @Dependency( \\ .context) var context
301
- init() {
302
- + // Don't prepare app dependencies in previews/tests.
303
- + guard context == .live else { return }
304
- prepareDependencies {
305
- // ...
306
- }
307
- // ...
308
- }
309
-
310
- var body: some Scene {
311
- WindowGroup {
312
- + // Don't load root view in previews/tests.
313
- + if context == .live {
314
- // ...
315
- + }
316
- }
317
- }
318
- }
319
- """
320
- )
321
289
return
322
290
}
323
291
#endif
You can’t perform that action at this time.
0 commit comments