Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in Swift 2.0

What's new in Swift 2.0

Mark Wilkinson

March 30, 2016
Tweet

More Decks by Mark Wilkinson

Other Decks in Technology

Transcript

  1. FIRST WHAT SWIFT 1.2 BROUGHT ▸ Speed enhancements, optimization in

    the runtime. Original issue with swift vs. obj-c ▸ if-let pyramids of doom deprecated ▸ Upcasts and Downcasts with as adds some optional safety ▸ Native Set added to the collection types ▸ let constants don’t have to be set at declaration ▸ Swift first-class citizenry enforced even more
  2. SWIFT 1.2 NULLABILITY ANNOTATIONS FOR BETTER OBJ-C TO SWIFT ▸

    nonnull, nullable, null_unspecified ▸ originally anything in the Cocoa API returned to swift an unwrapped optional (AnyObject!) ▸ potentially bad if nothing was there, no way to know! crashed at runtime! ▸ much easier to handle things like UIKit with methods that will return optionals or guaranteed instances.
  3. SWIFT 2.0 SWIFT 2.0 IS HERE ▸ Protocol extensions, default

    method implementations inside a protocol ▸ Error Handling, we now have throw, try, and catch ! ▸ guard statement for better readability and early logic exit ▸ API availability statement ▸ Automatically synthesized headers