Reputation:
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?
Upvotes: 0
Views: 4556
Reputation: 119254
There is No such a modifier as color()
. Use foregroundColor()
:
Text("Hello world")
.foregroundColor(.red)
Upvotes: 10