John Siracusa on Nostr: Q: Why is Xcode no longer able to render a preview of my SwiftUI view? A: ...
Q: Why is Xcode no longer able to render a preview of my SwiftUI view?
A: *Sometimes*, the answer is that you’ve got a call to a log method on a Logger object in a code path that’s executed when rendering a preview but rarely or not at all otherwise, and this call passes a string without any values interpolated into it (e.g., logger.log(“Hello”)). This causes an error, and this error is only visible in the big spew of output available through the stethoscope icon in the preview pane. #SwiftUWhy
A: *Sometimes*, the answer is that you’ve got a call to a log method on a Logger object in a code path that’s executed when rendering a preview but rarely or not at all otherwise, and this call passes a string without any values interpolated into it (e.g., logger.log(“Hello”)). This causes an error, and this error is only visible in the big spew of output available through the stethoscope icon in the preview pane. #SwiftUWhy