I used the Haneke Framework to get Data from a Site. With the Haneke Framework i also can get Images from a site, and these Images i can present on a UIImageView. Now i wanted to get some text from a site.
I did it like this:
cache.fetch(URL: URL).onSuccess { JSON in
println(JSON.dictionary?["index"])
It printed me all the data from "Index".
Now i want, that all the data from "Index" should be presented on a UITextView.
self.textView.text = JSON.dictionary["index"]
But it doesn't work. I get the error:
Cannot assign a value of type 'AnyObject' to a value of type 'String!'
I have to unwrap it or?
Finally, this prints out all records of the JSON text. The structure is an array of dictionaries. The text is very simply formatted (two tab characters between key and value).