Image(uiImage:) converts colored image to black and white
I have a data object that dynamically changes the UIImage
assigned to one of its instance variables, but when showing this image in SwiftUI, it’s always black and white. The following sample code shows the difference between the same image, but using first the native constructor Image(systemName:)
and then Image(uiImage:)
.
SwiftUI Image(uiImage:) converts colored image to black and white
I have a data object that dynamically changes the UIImage
assigned to one of its instance variables, but when showing this image in SwiftUI, it’s always black and white. The following sample code shows the difference between the same image, but using first the native constructor Image(systemName:)
and then Image(uiImage:)
.