2019/12/25 に開催した「みんなで Swift 復習会 GO! in 札幌」で使用した資料です。主にオープニング用の資料で、本編で使ったスライドは僅かで現場にいないと役に立たないかもしれませんが、何かの参考用に公開します。
実際の現場で使った本編資料は2ページですけれど、話が脱線する中で詳細に触れた項目が記載されていたページも数ページですけれど公開しておきました。
2018/11/09 の Swift 愛好会の LT で『Swift の let した変数に値を再代入してみよう』という問題提起をするのに使ったオープニング的なスライドです。
このスライドに「解答」は含まれていないので、この話題をきっかけにあれこれ試行錯誤して、さらにはそこから『どうして2回、代入することができたのか』みたいな理由を考える糸口にしてもらえたら嬉しいです。
This code snippet shows two switch statements in Swift. The first switch statement matches on a variable v and prints different outputs depending on which pattern matches. The second switch statement matches on a device variable and can match multiple patterns on one case or use a where clause to check for a suffix, printing outputs accordingly.
The document discusses control flow statements in Swift including if/else statements to check conditions, switch statements to check multiple options, and looping statements like for-in, while and repeat-while. It also provides examples of if let to safely unwrap optionals and the nil coalescing operator ?? to handle nil values.
This document does not contain any coherent summaries. It appears to be a mix of code snippets, emojis and Japanese text without clear context or meaning.
2019/12/25 に開催した「みんなで Swift 復習会 GO! in 札幌」で使用した資料です。主にオープニング用の資料で、本編で使ったスライドは僅かで現場にいないと役に立たないかもしれませんが、何かの参考用に公開します。
実際の現場で使った本編資料は2ページですけれど、話が脱線する中で詳細に触れた項目が記載されていたページも数ページですけれど公開しておきました。
2018/11/09 の Swift 愛好会の LT で『Swift の let した変数に値を再代入してみよう』という問題提起をするのに使ったオープニング的なスライドです。
このスライドに「解答」は含まれていないので、この話題をきっかけにあれこれ試行錯誤して、さらにはそこから『どうして2回、代入することができたのか』みたいな理由を考える糸口にしてもらえたら嬉しいです。
This code snippet shows two switch statements in Swift. The first switch statement matches on a variable v and prints different outputs depending on which pattern matches. The second switch statement matches on a device variable and can match multiple patterns on one case or use a where clause to check for a suffix, printing outputs accordingly.
The document discusses control flow statements in Swift including if/else statements to check conditions, switch statements to check multiple options, and looping statements like for-in, while and repeat-while. It also provides examples of if let to safely unwrap optionals and the nil coalescing operator ?? to handle nil values.
This document does not contain any coherent summaries. It appears to be a mix of code snippets, emojis and Japanese text without clear context or meaning.
42. // nil を除く全ての値を順番に処理する
for case let x? in optionalValues {
}
// 値が取得できなくなるまで、繰り返す。
while case let x? = iterator.next() {
}
43. // if で、オプショナルから値を取って判定
if let number = Int(string), number > 10 {
}
// switch で、オプショナルから値を取って判定
switch Int(string) {
case let number? where number > 10:
}