title: traitCollectionDidChange never called on UIView subclass
body: <p>I have a <code>UIViewController</code> that is presented modally by another <code>UIViewController</code>. This <code>UIViewController</code> has a <code>UITableView</code> with a custom <code>UIView</code> set for it's <code>tableFooterView</code>.</p>
  
  <p>So the issue I am having is: some colors are not displayed properly when switching the device's system appearance.
  As I have read, <code>cgColor</code> does not adapt automatically to appearance changes:</p>
  
  <blockquote>
    <p>The color object in this property does not adapt automatically to
    Dark Mode changes. If you use it to set the color of interface
    elements, you must update that color yourself when the
    userInterfaceStyle trait of the current trait collection changes. For
    information on how to apply color information reliably, see Supporting
    Dark Mode in Your Interface.</p>
  </blockquote>
  
  <p><a href="https://developer.apple.com/documentation/uikit/uicolor/1621954-cgcolor" rel="nofollow noreferrer">https://developer.apple.com/documentation/uikit/uicolor/1621954-cgcolor</a></p>
  
  <p>So to tackle this I am overriding the <code>traitCollectionDidChange</code> inside the <code>UIView</code> that uses <code>cgColor</code> like this:</p>
  
  <pre><code>override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
          super.traitCollectionDidChange(previousTraitCollection)
  
          updateView()
      }
  </code></pre>
  
  <p>In the <code>updateView</code> method, I simply update the <code>cgColor</code> properties of some sub layers, but this method never get called. I tried overriding this method in the <code>superview</code> of the <code>UIView</code> which has the same issue. It only gets called on the <code>UIViewController</code> level which is not useful because the <code>tableFooterView</code> is not set yet at that point in time.</p>
  
  <p>Any ideas how I can solve this?</p>