title: Xcode HTML to String return nil ?- SWIFT 3
body: <pre><code>public func setHtmlBody(_ body: String, bounds: CGRect = UIScreen.main.bounds) -&gt; String {
  
      let font = "-apple-system"
      let fontSize = 19
      let fontColor = "#000000"
      let lineHeight = 25
      let imageWidth = bounds.width - 40
      let margin = 20
      let codeStyle = "pre[class*=\"language-\"]{background:white;border-radius:14px;color:black;display:block;font-size:16px;font-weight:500;padding:20px;overflow-x:auto;white-space:pre-wrap;line-height:130%;}pre.language-coffeescript .token.comment{color:#6a7576}pre.language-coffeescript .token.string{color:#8ADC64}pre.language-coffeescript .token.number,pre.language-coffeescript .token.operator{color:#a580f8}pre.language-coffeescript .token.keyword,pre.language-coffeescript .token.class-name,pre.language-coffeescript .token.function{color:#8df}pre.language-swift .token.comment{color:#690}pre.language-swift .token.string{color:#ee433f}pre.language-swift .token.keyword{color:#C945A7}pre.language-swift .token.number,pre.language-swift .token.function,pre.language-swift .token.builtin,pre.language-swift .token.class-name{color:#5C2699}"
  
      let htmlString = "&lt;style&gt;p, li { font-family:\"\(font)\"; color: \(fontColor); font-size:\(fontSize)px; line-height:\(lineHeight)px } p { margin: \(margin)px 0; } img { max-width: \(imageWidth)px; } #p { font-weight: bold; font-size: 24px; line-height: 130%; margin: 50px 20px; } ul li, ol li { margin: 20px 0; font-weight: bold; } \(codeStyle)&lt;/style&gt;\(body)"
  
      return htmlString
  }
  </code></pre>
  
  <p>I am using swift 3. Why does the function return me to Nil?</p>
  
  <p>Usign:</p>
  
  <pre><code>bodyAttributedString = setHtmlBody(sectionBody).htmlToAttributedString
  </code></pre>