I have an array of SwiftyJson data that I have declared and filled it with data .The code I\'m using to fill the hoge array is this : self.hoge = JSON(data: data!)
Declare you main JSON Array as :
var data:[JSON] = []
If the data source is any other object (like realm) loop over it using for loop But if the data source is another JSON Array perform :
func setData(){
data = []
if let items = sourceData.array {
for item in items {
data.append(item)
}
}
collectionView.reloadData()
}