0
私はオブジェクトのリストを持っています。各オブジェクトにはオプションのイメージ値が含まれています。イメージ値は縮小する必要があります。すべての画像が初期化された後でリストを返すようにしたい。それはNSOPerationQueuesと関係がありますか?すべての実行中のブロックを追跡します
func getFullList(list:[AnyObject], completion:(result: [AnyObject]) -> Void {
for item in list {
downloadImage(item.url), completion: {(image) in
item.image = image
)}
// I know this does not work here
completion(result: list)
}