title: UITextView contain Bold and Regular string
body: <p>I would like to add a string to my <code>UITextView</code> and I would like some to be in bold and some in regular font. How should It do this? I have an example of what I would like to achieve below. </p>
  
  <p>Thanks</p>
  
  <pre><code>myTextView.text = "This is my string. "
  </code></pre>
  
  <p>This <strong>is</strong> my <strong>string</strong>.</p>
  
  <p>Below is the attempts I have made.</p>
  
  <pre><code>    // Define string attributes
      let font = UIFont(name: "Georgia", size: 18.0) ?? UIFont.systemFontOfSize(18.0)
      let textFont = [NSFontAttributeName:font]
  
      let fontItal = UIFont(name: "Georgia-Italic", size: 40.0) ?? UIFont.systemFontOfSize(40.0)
      let italFont = [NSFontAttributeName:fontItal]
  
      // Create a string that will be our paragraph
      let para = NSMutableAttributedString()
  
      // Create locally formatted strings
      let attrString1 = NSAttributedString(string: "This is ", attributes:textFont)
      let attrString2 = NSAttributedString(string: "my", attributes:italFont)
      let attrString3 = NSAttributedString(string: " string.", attributes:textFont)
  
      // Add locally formatted strings to paragraph
      para.appendAttributedString(attrString1)
      para.appendAttributedString(attrString2)
      para.appendAttributedString(attrString3)
  
      // Define paragraph styling
      let paraStyle = NSMutableParagraphStyle()
      paraStyle.firstLineHeadIndent = 15.0
      paraStyle.paragraphSpacingBefore = 10.0
  
      // Apply paragraph styles to paragraph
      para.addAttribute(NSParagraphStyleAttributeName, value: paraStyle, range: NSRange(location: 0,length: para.length))
  
  
      // Add string to UITextView
  
      myTextView.attributedText = para
  </code></pre>