title: Swift How can you reset the colors of all the subviews on a page?
body: <p>How can you automatically reset the colors of all the subviews on a page?</p>
  <p>I am defining dark mode colors doing something like this:</p>
  <pre><code>    static let textColor: UIColor = UITraitCollection.current.userInterfaceStyle == .light ? .black : .white
  </code></pre>
  <p>If a user has the app open when dark mode automatically takes place (based off a user's settings) then the colors do not change. You have to close the app and re-open it to see dark mode.</p>
  <p>How can you automatically reset the colors of all the subviews on a page?</p>
  <p>This is what I tried:</p>
  <pre><code> override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
      super.traitCollectionDidChange(previousTraitCollection)
      view.layoutSubviews()
      view.subviews.forEach {$0.layoutSubviews()}
  }
  </code></pre>
  <p>LayoutSubviews does not reset the color.</p>
  <p>Any ideas?</p>
  <p>Thanks!</p>