swift introduction to swift in ruby

38
Swift Introduction to Swift in Ruby

Upload: joseph-ku

Post on 10-May-2015

428 views

Category:

Technology


1 download

DESCRIPTION

2014-06-17 Presented on Ruby Tuesday #29

TRANSCRIPT

Page 1: Swift Introduction to Swift in Ruby

Swift Introduction to Swift in Ruby

Page 2: Swift Introduction to Swift in Ruby

@josephku

Page 3: Swift Introduction to Swift in Ruby
Page 4: Swift Introduction to Swift in Ruby
Page 5: Swift Introduction to Swift in Ruby

370,000

Page 6: Swift Introduction to Swift in Ruby

Safe Modern Power

Page 7: Swift Introduction to Swift in Ruby
Page 8: Swift Introduction to Swift in Ruby
Page 9: Swift Introduction to Swift in Ruby

No base class

Page 10: Swift Introduction to Swift in Ruby

@objc

Page 11: Swift Introduction to Swift in Ruby

Playground

Page 12: Swift Introduction to Swift in Ruby

Visual REPL

Page 13: Swift Introduction to Swift in Ruby

Use constant

Page 14: Swift Introduction to Swift in Ruby

letvar

Page 15: Swift Introduction to Swift in Ruby

Unicode

Page 16: Swift Introduction to Swift in Ruby

π

Page 17: Swift Introduction to Swift in Ruby

String Interpolation

Page 18: Swift Introduction to Swift in Ruby

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

Page 19: Swift Introduction to Swift in Ruby

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

Page 20: Swift Introduction to Swift in Ruby

Array & Dictionary

Page 21: Swift Introduction to Swift in Ruby

Array & Hash

Page 22: Swift Introduction to Swift in Ruby

1..10 1…10

Page 23: Swift Introduction to Swift in Ruby

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

Page 24: Swift Introduction to Swift in Ruby

Functional Programming

Page 25: Swift Introduction to Swift in Ruby

Structure & Class

Page 26: Swift Introduction to Swift in Ruby

Extensions

Page 27: Swift Introduction to Swift in Ruby

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

Page 28: Swift Introduction to Swift in Ruby

500.times { puts "Me again!" }

Page 29: Swift Introduction to Swift in Ruby

Tuple

Page 30: Swift Introduction to Swift in Ruby

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

Page 31: Swift Introduction to Swift in Ruby

?

Page 32: Swift Introduction to Swift in Ruby

var serverResponseCode: Int? = 404serverResponseCode = nil

Page 33: Swift Introduction to Swift in Ruby

Optional Chaining

Page 34: Swift Introduction to Swift in Ruby

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

Page 35: Swift Introduction to Swift in Ruby

RubyMotion

Page 36: Swift Introduction to Swift in Ruby

C’mon, it’s Ruby!!

Page 37: Swift Introduction to Swift in Ruby

?

Page 38: Swift Introduction to Swift in Ruby

Thank you!