R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

R.color compatible with trait collection not working

Open RaimundasSakalauskas opened this issue 2 years ago • 0 comments

My assumption for the API might be wrong, but I kinda assumed that R.color.white(compatibleWith: UIKit.UITraitCollection?) can be used to force returning color for specific interface mode, however this doesn't seem to work.

This doesn't work - always returns color based on currently active color scheme: R.color.white(compatibleWith: UITraitCollection(userInterfaceStyle: .light))

This however works as expected and returns color set for light mode: R.color.white()?.resolvedColor(with: UITraitCollection(userInterfaceStyle: .light))

Podfile.lock:

  - R.swift (6.1.0):
    - R.swift.Library (~> 5.3.0)
  - R.swift.Library (5.3.0)

RaimundasSakalauskas avatar Apr 21 '22 15:04 RaimundasSakalauskas