When setting a view's background color with withAlphaComponent with an alpha value other than 0.5, for example view.backgroundColor = UIColor(.dm, light: .white, dark: .black).withAlphaComponent(0.4), it would crash with:
it's weird that it would not crash with
view.backgroundColor = UIColor(.dm, light: .white, dark: .black).withAlphaComponent(0.5)
though
To solve this, we bridge CGColor call directly, instead of relying on message forwarding
When setting a view's background color with
withAlphaComponent
with an alpha value other than 0.5, for exampleview.backgroundColor = UIColor(.dm, light: .white, dark: .black).withAlphaComponent(0.4)
, it would crash with:it's weird that it would not crash with view.backgroundColor = UIColor(.dm, light: .white, dark: .black).withAlphaComponent(0.5) though
To solve this, we bridge CGColor call directly, instead of relying on message forwarding