microsoft / FluentDarkModeKit

A library for backporting Dark Mode in iOS
MIT License
1.63k stars 125 forks source link

Does it support layer? #74

Closed VineFiner closed 4 years ago

VineFiner commented 4 years ago

I use this

  view.layer.borderColor = UIColor (.dm, light color: .red, dark color: .green).cgColor

But there is no response.

levinli303 commented 4 years ago

No it does not. Neither does Apple's API.

To support dynamic color involving CGColor, you might want to manually set the color to your desired color in dmTraitCollectionDidChange of the view.

VineFiner commented 4 years ago

No it does not. Neither does Apple's API.

To support dynamic color involving CGColor, you might want to manually set the color to your desired color in dmTraitCollectionDidChange of the view.

Okay thank you. Is this library just an official extension?

levinli303 commented 4 years ago

The library has its own implementation and is not dependent on Apple's mechanism. However, we are working to align the library's API to that of Apple's for easy integration/migration.

icodesign commented 4 years ago

As pointed in README:

For more information on cases you should handle during layout, please refer to Apple's documentation.

you can put your code in any of the following layout methods. image