Add elements from SwiftyJSON to URL array in Swift
<p>I'm retrieving a list of URL images using Alamofire. The response is in JSON And I have used SwiftyJSON to parse and print each element. I want the URLs to be added into a URL array. Below is the code I have used</p>

<pre><code>var newArray = [URL(string: "http://www.tummyvision.com/users/uploads/gijovarghese141@gmail.com/photos/4.jpg")]

        Alamofire.request("http://www.tummyvision.com/users/login/get-images.php", parameters: parameters).responseData { response in
            let json = JSON(data: response.result.value!)
            for i in 0..&lt;json.count
            {
                print(json[i]) // prints the correct url
                self.urlArray.append(json[i])
            }
        }
</code></pre>

<p>But it is giving me the following error:</p>

<p><a href="https://i.stack.imgur.com/bdEut.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bdEut.png" alt="enter image description here"></a></p>