title: End of NSAttributedString with emojis left unformatted
body: <p>The end of my <code>NSAttributedString</code> with emojis in the contents is not being formatted. I'm trying to format the entire string (set the text color to white in this example, for simplification), but some of the text stays unformatted when put in a <code>UILabel</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/1tzuu.png" alt="enter image description here"></p>
  
  <p>Currently, I'm using</p>
  
  <pre><code>let attributedString = NSMutableAttributedString(string: contents)
  
  attributedString.addAttribute(
      NSForegroundColorAttributeName,
      value: UIColor.white,
      range: NSMakeRange(0, contents.characters.count)
  )
  
  label.attributedText = attributedString
  </code></pre>
  
  <p>I've also tried getting the length by using <code>contents.utf8.count</code> but get the same result.</p>
  
  <p>I noticed that the number of unformatted characters is the same as the number of emojis in the string. Could that have something to do with what's going on?</p>