title: issue cgColor switching in iOS 13 dark mode
body: <p>I'm facing trouble switching colours when change mode in iOS 13.</p>
  
  <p>The problem is when you see the app in recent apps. UIColors will change but cgColor will not change.</p>
  
  <p>It will change effectively when you open the app but just in recent it will not change.</p>
  
  <p>I'm using "traitCollectionDidChange" method as mentioned in following apple's document. 
  <a href="https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface" rel="nofollow noreferrer">https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface</a></p>
  
  <hr>
  
  <p><strong>Please have a look at Video to understand more clearly</strong> 
  <a href="https://www.youtube.com/watch?v=C-pcVuPMQ9U&amp;feature=youtu.be" rel="nofollow noreferrer">https://www.youtube.com/watch?v=C-pcVuPMQ9U&amp;feature=youtu.be</a></p>
  
  <hr>
  
  <pre><code>class ViewController: UIViewController {
  
      @IBOutlet weak var viewColor: UIView!
      let layerColor = CALayer()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view.
          setLayer()
          setColors()
      }
  
      override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
          super.traitCollectionDidChange(previousTraitCollection)
  
          if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
              setColors()
          }
      }
  
      func setColors() {
          layerColor.backgroundColor = UIColor(named: "layerColor")?.cgColor
      }
  
      func setLayer() {
          layerColor.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
          viewColor.layer.addSublayer(layerColor)
      }
  }
  </code></pre>