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

A Swift Approach

A Swift Approach

A quick lightning talk I given at NSLondon on some new concepts and features in Apple's new Language, Swift.

https://twitter.com/kylefuller

Kyle Fuller

July 24, 2014
Tweet

More Decks by Kyle Fuller

Other Decks in Technology

Transcript

  1. class TestObject { func testA() -> () { println("first test")

    } var testB:(() -> ()) = { println("second test") } }
  2. let point = (1, 2) switch point { case (0,

    0): println("(0, 0) is at the origin.") case (-2...2, -2...2): println("(\(point.0), \(point.1)) is near the origin.") default: println("The point is at (\(point.0), \(point.1)).") } // prints "(1, 2) is near the origin."
  3. func assert(predicate : () -> Bool) { #if !NDEBUG if

    !predicate() { abort() } #endif }