microsoft / FluentDarkModeKit

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

Fix missing attributes for UILabel when set attributedText in iOS 11 #102

Closed alex7vecher closed 3 years ago

alex7vecher commented 3 years ago

1) Use addAttribute instead of setAttributes to avoid losing other attributes besides .foregroundColor. 2) If the .foregroundColor attribute is not specified in the NSAttributedString, should be used UILabel textColor. This is standard behavior. Otherwise, the color of the UILabel text does not change.

levinli303 commented 3 years ago

looks good, thanks for you contribution!