user8354119
user8354119

Reputation:

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

Upvotes: 0

Views: 4556

Answers (1)

Mojtaba Hosseini
Mojtaba Hosseini

Reputation: 119254

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

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

Upvotes: 10

Related Questions