Is there any way of using a gradient as foregroundColor of Text in SwiftUI?
Thanks for the answers in advance!
This can be easily done in pure SwiftUI without using UIViewRepresentable. You need to mask a gradient with your text:
SwiftUI
UIViewRepresentable
LinearGradient(gradient: Gradient(colors: [.pink, .blue]), startPoint: .top, endPoint: .bottom) .mask(Text("your text"))