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

Joseph Ku

June 17, 2014
Tweet

More Decks by Joseph Ku

Other Decks in Technology

Transcript

  1. Swift Introduction to Swift in Ruby

    View full-size slide

  2. Safe
    Modern
    Power

    View full-size slide

  3. No base class

    View full-size slide

  4. Use constant

    View full-size slide

  5. String Interpolation

    View full-size slide

  6. let name = "Afu"
    let age = 3
    let greetings = "Hi! My name is \(name).
    My human age is \(age * 7)"
    println(greetings)

    View full-size slide

  7. puts "Hi! I am #{name}. My human age is #{age * 7}"

    View full-size slide

  8. Array & Dictionary

    View full-size slide

  9. Array & Hash

    View full-size slide

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

    View full-size slide

  11. Functional
    Programming

    View full-size slide

  12. Structure & Class

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  17. Optional Chaining

    View full-size slide

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

    View full-size slide

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

    View full-size slide