Search code examples
iosswiftswiftuiswiftui-listswiftui-form

SwiftUI - Value of type 'Text' has no member 'color' Error


I'm Getting Error in Swift UI Code That 1)Protocol type 'Any' cannot conform to 'View' because only concrete types can conform to protocols 2)Value of type 'Text' has no member 'color'

Can anyone find the Solution?

Here is Image What Actual issue is


Solution

  • There is No such a modifier as color(). Use foregroundColor():

    Text("Hello world")
        .foregroundColor(.red)