title: center and bold TextView swift
body: <p>Hi all I am trying to set a bold and centre to my text view I have 3 different colours in the view but I want the 2 colours that change to be centred. Is there a way to do this? below is my code.</p>
  
  <pre><code>        let myString:String = DisplayableContents.texts[10]
          var myMutableString = NSMutableAttributedString()
  
  
          myMutableString = NSMutableAttributedString(string: myString, attributes: [NSFontAttributeName:UIFont(name: "Calibri", size: 17.0)!])
  
          myMutableString.addAttribute(NSForegroundColorAttributeName, value: UIColor.red, range: NSRange(location:74, length:96))
          myMutableString.addAttribute(NSForegroundColorAttributeName, value: UIColor.gray, range: NSRange(location:96, length:19))
  
          // set label Attribute
  
          infoBox.attributedText = myMutableString
  </code></pre>