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

Swift Introduction to Swift in Ruby

Swift Introduction to Swift in Ruby

2014-06-17 Presented on Ruby Tuesday #29

7f403c925a51bf816b8c31c77c6f678b?s=128

Joseph Ku

June 17, 2014
Tweet

Transcript

  1. Swift Introduction to Swift in Ruby

  2. @josephku

  3. None
  4. None
  5. 370,000

  6. Safe Modern Power

  7. None
  8. None
  9. No base class

  10. @objc

  11. Playground

  12. Visual REPL

  13. Use constant

  14. let var

  15. Unicode

  16. π

  17. String Interpolation

  18. let name = "Afu" let age = 3 let greetings

    = "Hi! My name is \(name). My human age is \(age * 7)" println(greetings)
  19. puts "Hi! I am #{name}. My human age is #{age

    * 7}"
  20. Array & Dictionary

  21. Array & Hash

  22. 1..10 1…10

  23. if true { println("only me!") }

  24. Functional Programming

  25. Structure & Class

  26. Extensions

  27. 500.repeatitions { println("Me again!") }

  28. 500.times { puts "Me again!" }

  29. Tuple

  30. let someTuple: (Double, Double) = (3.14159, 2.71828)

  31. ?

  32. var serverResponseCode: Int? = 404 serverResponseCode = nil

  33. Optional Chaining

  34. num = paul.residence?.address?.buildingNumber?.toInt()

  35. RubyMotion

  36. C’mon, it’s Ruby!!

  37. ?

  38. Thank you!