swift-snapshot-testing icon indicating copy to clipboard operation
swift-snapshot-testing copied to clipboard

Cannot use Scene methods for URL, NSUserActivity, and other External Events without using SwiftUI Lifecycle Warning

Open slhodson969 opened this issue 3 years ago • 1 comments

Describe the bug

When running snapshot tests, if the view being tested uses the SwiftUI .onOpenURL modifier, a warning is produced that reads:

Cannot use Scene methods for URL, NSUserActivity, and other External Events without using SwiftUI Lifecycle. Without SwiftUI Lifecycle, advertising and handling External Events wastes resources, and will have unpredictable results.

To Reproduce Zipped up a very basic project that reproduces the behavior:

snapshot-demo-app-main.zip

Expected behavior We should not receive any warning

Environment

  • swift-snapshot-testing version: 1.9.0
  • Xcode: 13.2.1 (13C100)
  • Swift: 5
  • OS: iOS 15

slhodson969 avatar Mar 16 '22 14:03 slhodson969

This doesn't appear to be an issue with the library that we can control, so I am going to convert this to a discussion.

mbrandonw avatar Mar 16 '22 15:03 mbrandonw