Ios swift – How to use an @State property from a Sendable Closure in SwiftUI?
Here, hasComplexWave is a Boolean @State on a SwiftUI View. Here’s the code that uses it: view.visualEffect { [hasComplexWave] content, proxy in content.distortionEffect( ShaderLibrary.complexWave( .float(startDate.timeIntervalSinceNow), .float2(proxy.size), .float(0.5), .float(8), .float(10) ), maxSampleOffset: CGSize(width: 100, height: 100), isEnabled: hasComplexWave ) } The…