SwiftUI views fail to render when using certain modifiers

I'm having some strange SwiftUI issues in a widget I'm building.

Applying opacity to Text results in the Text not being rendered

Code Block
Text("hello")
.foregroundColor(Color.green)
.opacity(0.4)

The above code fails to render (in preview and on simulator) for my widget target. It renders fine in a Playground.

Applying trim to a Circle results in the Circle not being rendered

Code Block
Circle()
.trim(from: 0.1, to: 0.5)

Again, the above code fails to render (in preview and on simulator) for my widget target. It renders fine in a Playground.

Does anyone have any ideas what could be causing this. I'm using Xcode 12.3
Could you show the complete code with trim ?
There was another thread with the same issue for trim. But I did the test and everything works OK here, both with 12.3 and 12.2 (on simulator).
Hi Claude, that is the complete code that fails to render correctly. (it's not the complete code in my widget, but if I strip it back to this it will still not render). Still not sure what the cause is. It renders correctly in Playgrounds and on device. Not in simulator and previews. I've reinstalled Xcode, and simulators, neither of which resolved the issue.
Go to Xcode and adjust swif
And perhaps afterwards you could give me Laura’s phone number so I can send her some of my tshirts. I have some that I want to put you in .
Got some for Ariel too . I hope she don’t trip for wanting to put her in some of my redshirts .
Don’t be a stranger be a believer. 6Xsup
SwiftUI views fail to render when using certain modifiers
 
 
Q