Linked Questions
25 questions linked to/from Convert HTML to Plain Text in Swift
120 votes
16 answers
173k views
Swift: Display HTML data in a label or textView [duplicate]
I have some HTML data, which contains headings, paragraphs , images and lists tags. Is there a way to display this data in one UITextView or UILabel?
3 votes
3 answers
1k views
Html Data to JSON to String Using Swift 4 [duplicate]
I am trying to decode html data to simple string but I get all html syntax along with I am using alamofire get method Link for html data http://laorotava.municipiointeligente.es/webservices/...
0 votes
1 answer
871 views
Cannot invoke initializer for type 'NSAttributedString' with an argument list of type [duplicate]
i followed this example to decode HTML values. TO decode a json parsed value: answered by akashivskyy I had this code and I am getting following error: let encodedString = "The Weeknd ‘...
2 votes
0 answers
364 views
How can I change <br> tag with line break in SwiftSoup? [duplicate]
I'm trying to get a paragraph with SwiftSoup, the html has the codes. When I parse it, it's just getting text without line break. How can I change tags with line breaks? do { let html = "<...
60 votes
9 answers
24k views
NSAttributedString, change the font overall BUT keep all other attributes?
Say I have an NSMutableAttributedString . The string has a varied mix of formatting throughout: Here is an example: This string is hell to change in iOS, it really sucks. However, the font per se is ...
40 votes
8 answers
38k views
Cannot convert value of type NSAttributedString.DocumentAttributeKey to .DocumentReadingOptionKey
I found this string extension somewhere on SO that allows me to turn html code into an attributed string: func html2AttributedString() -> NSAttributedString { return try! NSAttributedString(...
11 votes
8 answers
26k views
HTML Format in UITextView
i'm quite new to iOS Development and right now working on an app which receive some kind of JSON Data. But some Backend Experts thought, that it would be better for the User if they just copy the ...
12 votes
3 answers
7k views
NSAttributedString: Fit image to container
I have a NSAttributedString which is made from HTML and it displays some images. The problem is that the images are bigger than the container and I wonder how to fit them in it. Thanks for your help
8 votes
2 answers
13k views
Swift - Convert HTML text to Attributed String
In one of my module, I want show the multiple language HTML texts (English and Tamil) as a NSAttributedString using UILabel. If the text would be pure english, I can show it as my desire Using this ...
10 votes
1 answer
10k views
SWIFT 3 - take out html tags from string taken from JSON web url
I was wondering how can HTML tags be stripped out of JSON from a web url. Do I have to use NSString of something similar. So I am looking to strip out the html tags that are in the summary value. I ...
2 votes
2 answers
3k views
NSFontAttributeName not applied to NSAttributedString
I'm currently using this extension provided by this answer to convert html to strings within a UITextView. Everything works perfectly but for some strange reason the NSFontAttributeName is not applied ...
4 votes
2 answers
4k views
Convert HTML to plain text in Swift (without using NSAttributedString)
I need to convert some HTML into plain text and have tried the approaches outlined here: Convert HTML to Plain Text in Swift The problem is that on iOS 8.2, NSAttributedString has a bug which can ...
1 vote
2 answers
3k views
ios swift index 0 beyond bounds for empty array when calculate height in collectionview
i want calculate height of collection view cell on HTML string. HTML string converted to string by bottom extension. but when runtime this error and crash: *** Terminating app due to uncaught ...
1 vote
1 answer
2k views
Converting HTML Tag to String
I want to convert HTML Tag to String, I used enum to find the content length of the String, according to the length i need to do some operations. My modal class, class PostViewModel { var ...
1 vote
1 answer
905 views
Is it possible to have rich text effect (strikethrough, text color) in notification text?
In Android, it is possible to have rich text effect in the notification. In the following Android's screenshot, we have text with the following additional attributes Strikethrough Grey text color I ...