<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Much obliged!! This syntax is clean and makes sense once I see it.<br><br>Sent from my iPhone, please excuse brevity and errors</div><div><br>On Jul 8, 2016, at 8:49 AM, Dan Loewenherz via swift-users <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">On Fri, Jul 8, 2016 at 10:34 AM, Roth Michaels via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jul 08 2016 at 11:11:04 AM, Nate Birkholz via swift-users <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br>
> This gives an error, expecting a colon (:) after object on every case.<br>
><br>
> I wanted to be sure I wasn't missing something in my syntax (nor some<br>
> obvious-to-others reason this isn't supported) before going to swift<br>
> evolution.<br>
<br>
</span>There is a bug filed to improve this error message:<br>
<a href="https://bugs.swift.org/browse/SR-2022" rel="noreferrer" target="_blank">https://bugs.swift.org/browse/SR-2022</a><br>
<span class=""><br>
On Fri, Jul 08 2016 at 11:15:48 AM, Dan Loewenherz via swift-users <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br>
> To my knowledge, you can’t do exactly what you’re trying to do<br>
<br>
</span>Here is how:<br>
<br>
```Swift<br>
<br>
for object in objects {<br>
switch object {<br>
case let object as Subclass1:<br>
doSomethingWith(object)<br>
case let object as Subclass2:<br>
doSomethingWith(object)<br>
case let object as Subclass3:<br>
doSomethingWith(object)<br>
default:<br>
break<br>
}<br>
}<br></blockquote><div><br></div><div>Beautiful, thanks Roth! This is much nicer. :)</div><div><br></div><div>Dan</div></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br></div></blockquote></body></html>