Is there any way how to create shadow in SwiftUI with the spread parameter (means of how much greater the shadow should be than the original view)? I've tried to use custom implementation of shadow using background Color with blur, but it resulted in performance issues.
I haven't found any other resources. I think that shadowPath would be helpful using UIKit, but I don't know any way ho to achieve it using SwiftUI.
Thanks for any advice!
Code Block swift content .background(GeometryReader { geometry in Rectangle() .fill(color) .frame(width: geometry.size.width + spread, height: geometry.size.height + spread) .cornerRadius(isCircle ? (geometry.size.width + spread) / 2 : cornerRadius) .padding([.top, .leading], -spread / 2) .padding(.leading, x) .padding(.top, y) .blur(radius: blur) })
I haven't found any other resources. I think that shadowPath would be helpful using UIKit, but I don't know any way ho to achieve it using SwiftUI.
Thanks for any advice!