Skip to content

Instantly share code, notes, and snippets.

@akuraru
Last active May 31, 2016 02:07
Show Gist options
  • Save akuraru/7388c5f93080d38f3d96749bae820325 to your computer and use it in GitHub Desktop.
Save akuraru/7388c5f93080d38f3d96749bae820325 to your computer and use it in GitHub Desktop.
Arrayを逆順に評価する
let array = [1, 2, 3, 4, 5]
for num in array.reverse() {
print("num: \(num)");
}
for (index, num) in array.enumerate().reverse() {
print("num: \(num)");
print("inde: \(index)\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment