On Jul 7, 2015, at 01:39 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> The problem arises when you want to initialize more than one variable in that 
> block of work.

If you ask the wrong question, you get a wrong answer. :)

You can use a tuple:

> let (thumbURL, isHero) =
> {
>       () -> (String?, Bool) in
>       
>       for imgD in images
>       {
>               if let isHero = imgD["is_hero"] as? Bool where isHero,
>                       let t = imgD["thumbnail_signed_src"] as? String
>               {
>                       return (t, isHero)
>               }
>       }
>       
>       return (nil, false)
> } ()

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to