Search code examples
iosswiftuinavbaruicolor

Cannot convert value of type 'Color' to expected argument type 'UIColor?'


hello everyone i'm trying to make a navbar with a hexacedimal color in the asset file named "tint" but i have this error "Cannot convert value of type 'Color' to expected argument type 'UIColor?

.navigationBarColor(Color("tint"))

Solution

  • Simply create new UIColor using that color

    navigationBarColor(UIColor(Color("tint")))