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

D200a17dd269fd4001bacb11662dab4b?s=128

Kyle Fuller

July 24, 2014
Tweet

Transcript

  1. 3.
  2. 5.
  3. 18.
  4. 22.
  5. 23.
  6. 34.
  7. 35.
  8. 37.

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

    } var testB:(() -> ()) = { println("second test") } }
  9. 42.
  10. 46.

    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."
  11. 52.

    func assert(predicate : () -> Bool) { #if !NDEBUG if

    !predicate() { abort() } #endif }
  12. 55.
  13. 56.
  14. 62.
  15. 64.
  16. 65.
  17. 67.
  18. 73.
  19. 74.