Currently we have an array which contains all the contents of the JSON Object:
var castArray: [CastData] = []
CastData.updateAllData(urlExtension: "\(movieID)/credits", completionHandler: { results in
guard let results = results else {
print("There was an error retrieving upcoming movie data")
return
}
self.castArray = results
})
I'm trying to split the results of the JSON object into 2 arrays, the first 5 will go into the first array, the remainder will go into the 2nd array:
var first5CastArrayObjects: [CastData]
var theRestofTheCastArrayObjects: [CastData]
What would be the best way to do this?