D
D
Dima Grib2018-03-08 00:36:50
JSON
Dima Grib, 2018-03-08 00:36:50

How to add additional check for Json Response method?

Friends, a hint is needed on how to add one more check to the JSON Response method, before the loop / receiving data
. The method itself looks like this

func mediaImage() {
        if let mediaImages = json["......."]["......._media"]["....."]["......."][].array {
            for images in mediaImages {
                self.........append(images["......."]["......."]["......."].stringValue)
            }
                print("Media Images = \(self........)")
            } else {
            print("No Media Images")
        }
    }

One more check is missing after entering the array. I need to compare the value of this line with the .stringValue constants and then skip the method in extracting media information. I will be very grateful

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2018-03-08
@YeahGarage

Let's start with the fact that you are using the library as I understood SwiftyJSON? What you have highlighted in blue on the screen is not clear how to check, show what's inside.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question