- Open
PreviewFailingTestProject.xcodeproj
- Change Target at the top of the Xcode window from
PreviewFailingTestProject
toMyUICode
- Change deployment device to iPhone 12 mini (or any iOS device)
- Open file: LocalPackages > MyUICode > Sources > MyUICode > ThisViewCrashesPreview.swift
- Try to use the SwiftUI Previewer
- Crash will occur and preview will not render, see lines 8-11 of
ThisViewCrashesPreview.swift
for more details - NOTE: See file: PreviewFailingTestProject > PreviewFailingTestProjectApp.swift > MainWindow View on lines 13-19. This renders fine on both the SwiftUI Previewer and when deployed to device.