So I am fairly new to working with iOS applications and I am currently working on an application which pulls data from a website using NSURLSessionDataTask
, parses the JSON response (HTML), and then populates a view with data from the response.
Currently, I am stuck trying to find a solution to correctly parsing my current HTML string (of type __NSCFString/NSString
) from the JSON response, and putting the text into one or more UITextViews
and images into one or more UIImageViews
within the main ViewController
.
It has previously been suggested to simply use a UIWebView
to display everything or to use an outside library to do some of the converting, however I am curious if there are any methods by which I could parse the HTML and extract all relevant text or images and throw them into an array for later use. I would very much prefer to keep all of this native and not use outside libraries unless absolutely necessary.
I have also seen some use of the NSAttributedString
class for parsing HTML from a JSON response, but am unsure if this is even relevant to what I am trying to do here. Any help/suggestions/thoughts are appreciated!