title: Autoresizing image of html content in a UITextView
body: <p>I have the body (HTML with images) of a wordpress article obtained via JSON, I'm using a UITextView` to show it and everything works correctly, except that the image that contains the HTML only shows a part.</p>
  
  <p>To format the HTML content, I use the following extension:</p>
  
  <pre><code>extension NSAttributedString {
      convenience init?(html: String) {
          guard let data = html.data(using: String.Encoding.unicode, allowLossyConversion: false) else {
              return nil
          }
          guard let attributedString = try? NSAttributedString(data: data, options: [NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) else {
              return nil
          }
          self.init(attributedString: attributedString)
      }
  }
  </code></pre>
  
  <p>and to show it in the UITextView, I do it like this:</p>
  
  <pre><code>myTextView.attributedText = NSAttributedString(html: htmlString!)
  </code></pre>
  
  <p>In var <code>htmlString</code>: HTML is stored.</p>
  
  <p>All good, except that when loading the image of the HTML content it does not scale.</p>
  
  <p><a href="https://i.stack.imgur.com/SpgLH.jpg" rel="nofollow noreferrer">This is how the image looks</a></p>
  
  <p><strong>How could I make the HTML content images show autoscaling?</strong></p>
  
  <p>The html code of the images are similar to:</p>
  
  <pre><code>&lt;img class="alignnone size-full wp-image-9667" src="https://.../wp-content/uploads/2016/02/image.jpg" alt="image" width="612" height="894"&gt;
  </code></pre>
  
  <p><strong>CSS could be added?</strong></p>