title: How to set NSAttributedString text color?
body: <p>I tried to set some attributes to an NSAttributedString. Everything works except for the foreground color.</p>
  <p>This is how I tried to set the attributes:</p>
  <pre><code>func setLabelText(text:String){
      let strokeTextAttributes = [
          NSAttributedString.Key.strokeColor : UIColor.white,
          NSAttributedString.Key.foregroundColor : UIColor.red,
          NSAttributedString.Key.font : UIFont.init(name: &quot;Raleway-ExtraBold&quot;, size: 26)!,
          NSAttributedString.Key.strokeWidth : 0.5,
      ]
        as [NSAttributedString.Key : Any]
      label.attributedText = NSMutableAttributedString(string: text, attributes: strokeTextAttributes)
  }
  </code></pre>
  <p>As you can see in the image it does not set the text color:</p>
  <p><a href="https://i.stack.imgur.com/6YoAz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6YoAz.png" alt="enter image description here" /></a></p>
  <p>Do you know why it ignores the foregroundColor attribute?</p>
  <p>Thanks in advance.</p>