Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swift3.0が出る前に 基礎の見直し:guard

Swift3.0が出る前に 基礎の見直し:guard

Early Exit

jollyjoester

July 02, 2016
Tweet

More Decks by jollyjoester

Other Decks in Education

Transcript

  1. 1೥લ->ࠓճ • let / var : ࠶୅ೖͰ͖Δ͔൱Λ໌֬ʹ෼཭ • struct /

    class : ঢ়ଶͷ༗ແΛ໌֬ʹ෼཭ • Optional : nil͔஋͋Γ͔Λ໌֬ʹ෼཭ • ɾɾɾ • ʲࠓճʳҟৗܥͱਖ਼ৗܥΛ໌֬ʹ෼཭
  2. guard Early Exit A guard statement, like an if statement,

    executes statements depending on the Boolean value of an expression. You use a guard statement to require that a condition must be true in order for the code after the guard statement to be executed. ཁ͸ifΈ͍ͨͳ΍ͭͬͯ͜ͱͰɻ Excerpt From: Apple Inc. “The Swift Programming Language (Swift 2.1).” iBooks. https://itun.es/jp/jEUH0.l