Reputation: 2395
I have a project written in Swift 2.0 that exports some HTML
written text as a PDF. I want to insert an image into my HTML but have to use quotations for the <img src= "dividerImage.png">
. It it is not accepting the quotes because it is already within the url string
text quotations as shown:
url = "<h>Title of PDF</h> [image source text here] <body>PDF body text here</body>"
Is what I'm trying to do not possible? I've search online for documentation on this in Swift 2.0 with no luck. Thank you.
Upvotes: 0
Views: 1635
Reputation: 176
You can use simple quote:
url = "<h>Title of PDF</h> <img src= 'dividerImage.png'> <body>PDF body text here</body>"
or escape double quote:
url = "<h>Title of PDF</h> <img src= \"dividerImage.png\"> <body>PDF body text here</body>"
Upvotes: 2