Closed Brett-Best closed 2 years ago
@Brett-Best thank you for spotting this. Looks like the api changed in the recent beta release, this can be resolved by moving the .bendMode
modifier up inside the foregroundStyle
so that it is now applied directly to the LinearGradient
.
.foregroundStyle(
LinearGradient(
gradient: Gradient (
colors: [
.indigo.opacity(0.05),
.purple.opacity(0.5)
]
),
startPoint: .top,
endPoint: .bottom
).blendMode(.darken)
)
Ah nice, wasn’t sure if that was producing the same result, thanks! 😊
I was trying to follow the article that includes the below line of code. Seems that it doesn’t compile with Xcode 14b5 :( https://github.com/NilCoalescing/SwiftUI-Code-Examples/blob/be5ffae4f4e4df4c50f86e20bc79789225817ef4/BuildAndStyleAChartWithSwiftChartsFramework/SimpleBabyChart.swift#L43
I get:
I couldn’t find anything in the Xcode or iOS release notes about a change in this API.