dimanche 28 juin 2015

Swift Haneke: Json Data in TextView

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?

Aucun commentaire:

Enregistrer un commentaire