<div dir="ltr">I am not sure if this helps, This is how I understand it.<div><br></div><div>what happens when you use normal switch.</div><div><br></div><div>switch someEnumExpression {</div><div> case someEnum.Element1: execute block / statements </div><div> default: executeDefault</div><div>}</div><div><br></div><div>// it checks each case with someEnumExpression, and if true then run it, may be actual implementation might use dictionary with someEnum as Key</div><div>if case someEnum.Element1 == someEnumExpression {</div><div>  execute block / statements </div><div>} else {</div><div>  executeDefault</div><div>}</div><div><br></div><div>unroll your switch to if&#39;s, then I am sure you will understand its construct...but why swift provide this control branch statements with case, because at time I am sure that or only want to check an expression is of particular enum case, then I use the if case like above. while is similar.</div><div><br></div><div>I am sorry if my explanation is vague.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 24, 2016 at 10:49 AM, Thomas# Chiang via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>have any document explain about &quot;while case&quot; and &quot;if case&quot; ? thank you ~<br><br></div>TMS#<br></div>
<br>_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div>