How can I add image in UITextView?
<p>I'm making a note taking app but I ran into trouble.</p>

<p>I want to put a image in <strong>UITextView</strong>. I used <strong>NSAttributedString</strong> to put the image in <strong>UITextView</strong> but when I put image from the imagepicker, the image size is too big like this </p>

<p><img src="https://i.stack.imgur.com/Kdd85.png" alt="image"></p>

<p>I want to make it like the apple notes app</p>

<p><img src="https://i.stack.imgur.com/F6V5U.png" alt="image2"></p>

<p>How can I figure that?</p>

<pre><code>   let images = selectedImage
   let attachment = NSTextAttachment()

   attachment.image = images

   let attString = NSAttributedString(attachment: attachment)

   textView.textStorage.insertAttributedString(attString, atIndex: textView.selectedRange.location)
</code></pre>