I have a UIImageView
in my app. I want to display it's image in some html content which I am rendering in app. This is a small html code which displays image in html :
<td class="title"> <img src="#LOGO_IMAGE#" style="width:100%; max-width:300px; background-color: #cdcdcd">
</td>
This is what I am doing in Swift
to get url (I am aware this is incorrect) :
let logoString = String(data: imageData, encoding: .utf8)
HTMLContent = HTMLContent.replacingOccurrences(of: "#LOGO_IMAGE#", with: logoString!)
Line number 1 gives me nil
.
How may I fix this ?