Skip to content

Instantly share code, notes, and snippets.

@rizumita
Last active August 29, 2015 14:03
Show Gist options
  • Save rizumita/a1eedd66d0dd20d179b7 to your computer and use it in GitHub Desktop.
Save rizumita/a1eedd66d0dd20d179b7 to your computer and use it in GitHub Desktop.
Swiftのif letでは二つ以上の変数を同時に束縛できないのでその代替方法 ref: http://qiita.com/rizumita/items/14f92c540039af16b7a5
let first : Int? = "1".toInt()
let second : Int? = "2".toInt()
switch (first, second) {
case (.Some(let f), .Some(let s)):
println(f + s)
default:
println("error")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment