iOhYes Retired


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 →

71: Episode 71 - Smooth Operators

June 4, 2015 at 12:00PM • 1 hour 4 minutes • Wiki Entry

We continue our discussion of Swift by covering Operators and spend a little time talking about things we like to see at WWDC.

Show Notes & Links Presented by CacheFly

Tweet Shoutouts

Send your tweet shoutouts to @iOhYesPodcast.

The Discussion

  • Operators
    • Unary Prefix (appears before a single target), Binary Infix (between two targets), Unary Postfix (after a single target)
    • Infix requires precedence and associativity
      • Operator Associativity
      • Grouped from the left or right
    • Special kinds of operators
      • Compound assignment - combine assignment with another operation. The left (or only) input parameter needs to be marked inout, so you can modify the value from within the function. Example: +=
      • Equivalence operators: == and != (Do we know why we need to explicitly implement the inequality operator?)
    • Existing operators can be overloaded by defining a global function with a name that matches the operator to be overloaded.
    • Custom Operators
      • Declared at global level with operator keyword
      • Custom operators can begin with one of the ASCII characters /, =, -, +, !, *, %, <, >, &, |, ^, ?, or ~, or one of the Unicode characters defined in the grammar
  • WWDC Wishlist




Alternative Show Titles

  • Square Brackets All The Way Down
  • Homework: Incomplete
  • An Implicit Need To Capture Self
  • Right On…Or Left On
  • Rhetorical Pontification
  • There Be Dragons, But We're Not Going To Tell You Where
  • Complications