Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Chargement dans…3
×

Consultez-les par la suite

1 sur 46 Publicité

Plus De Contenu Connexe

Plus par Tomohiro Kumagai (20)

Plus récents (20)

Publicité

みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift

  1. 1. #minna_de_swift
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6. while condition { }
  7. 7. repeat { } while condition
  8. 8. // switch での分岐はパターンマッチを使っている switch x { case 1 ..< 10: } // if 文でもパターンマッチが使える if case 1 ..< 10 = x { }
  9. 9. // nil を除く全ての値を順番に処理する for case let x? in optionalValues { } // 値が取得できなくなるまで、繰り返す。 while case let x? = iterator.next() { }
  10. 10. // if で、オプショナルから値を取って判定 if let number = Int(string), number > 10 { } // switch で、オプショナルから値を取って判定 switch Int(string) { case let number? where number > 10: }
  11. 11. // 要素を順番に処理する。ただし条件を満たすものだけ。 for value in values where value < 10 { } // 両方の条件が満たされる間、処理する。 while let value = iterator.next(), value < 10 { }
  12. 12. // item は (Key, Value) 型のタプルで取得 for item in dictionary { } // Key と Value を、それぞれ key と value に分けて取得 for (key, value) in dictionary { }

×