iOhYes Retired

iOhYes

A podcast by iOS developers for iOS developers, delivering news, tips, and rants for professional iOS/Mac developers, with something for enterprise and indie developers alike.

Hosted by Darryl Thomas and John Sextro.



← Previous Episode   |   Next Episode →

62: Episode 62 - It's Closures All the Way Down

April 3, 2015 at 8:45AM • 58 minutes • Wiki Entry

Swift

  • Follow-up/Corrections
  • 2 episodes ago, Darryl mistakenly referred to Swift 1.3 beta. He meant to say 1.2 beta.
    • Tuples
      • Contents can be decomposed in a manner very similar to the decomposition of an enum value’s associated values
      • Elements can be accessed using dot notation with its zero-based index.
    • Particularly useful as the return value of functions
      • Group values into a single compound value.
      • Values need not be of the same type
      • Multiple ways of getting at the composed values
        • “_” can be used to ignore parts of a tuple.
      • Elements of a tuple can be named, and subsequently accessed by name using dot syntax.
      • If the data structure is likely to persist beyond a temporary scope, consider a class or structure instead.
  • Functions
    • syntax
    • parameters
      • local vs. external parameter names
      • variadic
      • in-out
      • default parameter values
    •  return
      • multiple return values
      • option tuple return types
      • void defined as empty tuple ()
    • function types
      • syntax
      • as parameters
      • as return types
  • Closures
    • terseness
    • Types
      • Global Functions
      • Nested Functions
      • Closure Expressions
    • Trailing Closures



Show Notes & Links Presented by CacheFly

Tweet Shoutouts

The Discussion

Swift

  • Follow-up/Corrections
  • 2 episodes ago, Darryl mistakenly referred to Swift 1.3 beta. He meant to say 1.2 beta.
    • Tuples
      • Contents can be decomposed in a manner very similar to the decomposition of an enum value’s associated values
      • Elements can be accessed using dot notation with its zero-based index.
    • Particularly useful as the return value of functions
      • Group values into a single compound value.
      • Values need not be of the same type
      • Multiple ways of getting at the composed values
        • “_” can be used to ignore parts of a tuple.
      • Elements of a tuple can be named, and subsequently accessed by name using dot syntax.
      • If the data structure is likely to persist beyond a temporary scope, consider a class or structure instead.
  • Functions
    • syntax
    • parameters
      • local vs. external parameter names
      • variadic
      • in-out
      • default parameter values
    •  return
      • multiple return values
      • option tuple return types
      • void defined as empty tuple ()
    • function types
      • syntax
      • as parameters
      • as return types
  • Closures
    • terseness
    • Types
      • Global Functions
      • Nested Functions
      • Closure Expressions
    • Trailing Closures

Picks

Darryl

John

Alternative show title suggestions

  • Make it swift
  • Tuples
  • Changed the rules
  • Variadic
  • Surprise
  • Magical Functions
  • Closed the book on closure
  • Whoever decides they want to write a blog post