Skip to content

Instantly share code, notes, and snippets.

@ivangodfather
Created October 20, 2018 05:07
Show Gist options
  • Select an option

  • Save ivangodfather/72ff408fb1f2884608e98d9731994e68 to your computer and use it in GitHub Desktop.

Select an option

Save ivangodfather/72ff408fb1f2884608e98d9731994e68 to your computer and use it in GitHub Desktop.
let rndStrings = ["a", "b", "c"]
var rndInts = [Int]()
rndStrings.forEach { rndString in
someAsyncMethod { intResult in
rndInts.append(intResult)
}
}
// i want to wait until rndInts has all 3 values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment