title: iOS UILabel textColor not updating in dark mode
body: <p>I have a collection view which shows time slots in the app. In the dark mode, it seems the UILabel is not showing the black text color on white background.</p>
  
  <p>In the storyboard, I have set the color as Black (also tried the Default color) for the label. </p>
  
  <p>In the code, when user select the cell,</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  
     if let cell = collectionView.cellForItem(at: indexPath) as? TimeCell{
        cell.timeLabel.toggleTheme(true)
     }
   }
  </code></pre>
  
  <p>and I have the UILabel extension:</p>
  
  <pre><code>extension UILabel{
  
      func toggleTheme(_ selected : Bool){
          if selected{
              if #available(iOS 13.0, *) {
                  if self.traitCollection.userInterfaceStyle == .dark{
                      self.textColor = UIColor.black
                      self.backgroundColor = UIColor.white
                  }else{
                      self.textColor = UIColor.white
                      self.backgroundColor = UIColor.black
                  }
              } else {
                   self.textColor = UIColor.white
                   self.backgroundColor = UIColor.black
              }
  
          }else{
              if #available(iOS 13.0, *) {
                  if self.traitCollection.userInterfaceStyle == .dark{
                      self.textColor = UIColor.white
                      self.backgroundColor = UIColor.black
                  }else{
                      self.textColor = UIColor.black
                      self.backgroundColor = UIColor.white
                  }
              } else {
                   self.textColor = UIColor.black
                   self.backgroundColor = UIColor.white
              }
  
          }
      }
  
  }
  </code></pre>
  
  <p>and the result is:</p>
  
  <p><a href="https://i.stack.imgur.com/2rBgJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2rBgJ.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/PRZhU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PRZhU.png" alt="enter image description here"></a></p>