title: NSTextAttachment image alignment
body: <p>I am following this cool tutorial <a href="http://ossh.com.au/design-and-technology/software-development/implementing-rich-text-with-images-on-os-x-and-ios/comment-page-1/#comment-873" rel="noreferrer">Implementing Rich Text with Images on OS X and iOS</a> by @Duncan Groenewald and was able to display images in my <code>UITextView</code>. However, these images are not centered they way I would like them to be. See image</p>
  
  <p><img src="https://i.stack.imgur.com/9iYy5.png" alt="NSTextAttachment sample image"></p>
  
  <p>As you can see, I would like my image to be centered on the X-axis. </p>
  
  <p>I tried returning the <code>rect</code> with appropriate values in <code>-attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex</code> but that did not help. </p>
  
  <p>I also tried setting the <code>NSKernAttributeName</code> for the <code>NSTextAttachment</code> attributed string. But all it did was hide the image some how. </p>