Why SFSymbol "face.smiling" will changed to "face.smiling.fill" when switching to dark mode.

I am using XCode 14.

The following is the UIImageView, using SFSymbol face.smiling

  • UIImageView background is pink color
  • UIImageView tint is black color

When I switch my app to dark mode, the smiling face which use to be transparent color, has became solid black color.

The face line (eye, mouth, face border) used to be solid black color, had became transparent color.

It seems like the image has changed from "face.smiling" to "face.smiling.fill" ?

I would like to avoid such outcome. Is there a way, to force UIImageView load SFSymbol in light mode, even though the entire app is using dark mode?

(This happens same when I test using real device and simulator)

Thanks.

Environment Variable?

I know in SwiftUI you can:

struct SmileyFaceView: View {
    @Environment(\.colorScheme) var scheme
    var body: some View {
        Image(systemName: "face.smiling")
            .foregroundColor(scheme == .light ? .black : .white) //  this is to change to color according to the scheme
            .environment(\.colorScheme, .light) // This is to force the icon to the face.smily
    }
}

for your need

not sure in UIKit

Report a bug FB

Why SFSymbol "face.smiling" will changed to "face.smiling.fill" when switching to dark mode.
 
 
Q