Is there any way of using a gradient as foregroundColor of Text in SwiftUI?
Thanks for the answers in advance!
You can use this to have gradient as foreground color of your Text:
Text("Hello World")
.padding()
.foregroundColor(.white)
.background(LinearGradient(gradient: Gradient(colors: [.white, .black]), startPoint: .top, endPoint: .bottom))
Hope this helps :) you can also use this link for your reference: https://www.hackingwithswift.com/quick-start/swiftui/how-to-render-a-gradient