SmoothShadows is a SwiftUI package that lets you add customizable, smoother shadows to your views.
Swift Package Manager
- Open your Xcode project.
- Navigate to
File>Add Package Dependencies.... - Enter the repository URL:
https://github.com/atlou/SmoothShadows/. - Select “Add Package” to integrate SmoothShadows into your project.
Import the package in your SwiftUI file:
import SmoothShadows
Apply the smoothShadow modifier to a view:
Rectangle()
.smoothShadow(color: .black.opacity(0.5), y: 10)Parameters
color: The color of the shadow.x: Horizontal offset of the shadow.y: Vertical offset of the shadow.
This package is available under the MIT license. See the LICENSE file for more information.