Skip to content

Instantly share code, notes, and snippets.

@keitaito
Last active April 21, 2016 07:54
Show Gist options
  • Save keitaito/8a1014bbabaab780459dd4de50fab902 to your computer and use it in GitHub Desktop.
Save keitaito/8a1014bbabaab780459dd4de50fab902 to your computer and use it in GitHub Desktop.
ShorhandArgumentNamesExample.swift - Run this code on Playground
//: Playground - noun: a place where people can play
let tuples = [("A", "あ"), ("I", "い"), ("U", "う"), ("E", "え"), ("O", "お")]
print("With argument list")
tuples.forEach { (eng, jpn) in
print(eng)
print(jpn)
}
print("Shorthand argument names")
tuples.forEach {
print($0)
print($1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment