I have this variable:
var fetchedImagesArray: [String] = []
Then I fetch an array of images name from my server using Alamofire and SwiftyJson like this:
if let fetchedImages = json["images"].arrayObject {
fetchedImagesArray = fetchedImages
}
But I get the error here fetchedImagesArray = fetchedImages saying: cannot assign value of type anyobject to type string.
The array returned loooks like this ["imgName1","imgName2","imgName3"] which is all strings to why cant I set fetchedImagesArray?
if let fetchedImages = json["images"].arrayObject as [String]