79700562

Date: 2025-07-14 07:58:14
Score: 0.5
Natty:
Report link
struct BlurLinearGradient: View {
    let image: Image
    
    var body: some View {
        ZStack {
            image
                .resizable()
                .scaledToFill()
            
            image
                .resizable()
                .scaledToFill()
                .blur(radius: 20, opaque: true)
                .mask {
                    LinearGradient(
                        colors: [.clear, .black],
                        startPoint: .center,
                        endPoint: .bottom
                    )
                }
        }
    }
}

// Usage
struct ContentView: View {
    var body: some View {
        BlurLinearGradient(image: Image("f1"))
            .frame(width: 280, height: 480)
            .clipShape(RoundedRectangle(cornerRadius: 8))
    }
}

Result:

BlurLinearGradient result

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: M_Khater