SlideShare uma empresa Scribd logo
1 de 113
Baixar para ler offline
A Modest Intro To Swift — ATO 2017 — @genehack 1
a modest introduction to
swiftjohn sj anderson | @genehack | ato 2017
A Modest Intro To Swift — ATO 2017 — @genehack 2
sorry!A Modest Intro To Swift — ATO 2017 — @genehack 3
hi i’m john
aka @genehack
vp tech,
infinity interactive
A Modest Intro To Swift — ATO 2017 — @genehack 4
swift?A Modest Intro To Swift — ATO 2017 — @genehack 5
introduced in
2014A Modest Intro To Swift — ATO 2017 — @genehack 6
open source
at version 2.2
A Modest Intro To Swift — ATO 2017 — @genehack 7
version 4.0
just released
(in september)
A Modest Intro To Swift — ATO 2017 — @genehack 8
originally
macOS only
A Modest Intro To Swift — ATO 2017 — @genehack 9
now also on
linuxA Modest Intro To Swift — ATO 2017 — @genehack 10
A Modest Intro To Swift — ATO 2017 — @genehack 11
also on android
and windows
A Modest Intro To Swift — ATO 2017 — @genehack 12
so what’s
it like,
maaan?
A Modest Intro To Swift — ATO 2017 — @genehack 13
first,
a brief
digression
A Modest Intro To Swift — ATO 2017 — @genehack 14
how many macOS / iOS
users
do we have here?A Modest Intro To Swift — ATO 2017 — @genehack 15
how many macOS / iOS
developers
do we have?
A Modest Intro To Swift — ATO 2017 — @genehack 16
the dirty little secret
of developing
for apple platforms
A Modest Intro To Swift — ATO 2017 — @genehack 17
from“In The Beginning Was The Command Line”
by neal stephenson
A Modest Intro To Swift — ATO 2017 — @genehack 18
weird pascal-based
naming & calling
conventions
A Modest Intro To Swift — ATO 2017 — @genehack 19
handles?!?
A Modest Intro To Swift — ATO 2017 — @genehack 20
objective c’s
“syntax”
A Modest Intro To Swift — ATO 2017 — @genehack 21
swift
is the macintosh
of apple programming languages
A Modest Intro To Swift — ATO 2017 — @genehack 22
swift
syntax
A Modest Intro To Swift — ATO 2017 — @genehack 23
comments
// this is a comment
A Modest Intro To Swift — ATO 2017 — @genehack 24
comments
/* this is a
multi-line
comment */
A Modest Intro To Swift — ATO 2017 — @genehack 25
comments
/* this is a
/* _nested_
multi-line
comment, */
which is cool! */
A Modest Intro To Swift — ATO 2017 — @genehack 26
variables
var foo = 1
var bar :Int
var baz = "whee!"
A Modest Intro To Swift — ATO 2017 — @genehack 27
variables
let bar = 1
A Modest Intro To Swift — ATO 2017 — @genehack 28
variables
let bar = 1
bar += 1
// ^^ compile time error!
A Modest Intro To Swift — ATO 2017 — @genehack 29
variables
let bar
// also a compile time error
// You CANNOT have an untyped, uninitialized variable.
// You also can't use an uninitialized variable _at all_.
A Modest Intro To Swift — ATO 2017 — @genehack 30
how friggin’
awesome
is that?
A Modest Intro To Swift — ATO 2017 — @genehack 31
flow control: conditionals
let n = 1
if n > 1 {
print("we got a big N here")
}
A Modest Intro To Swift — ATO 2017 — @genehack 32
flow control: loops
let arr = [ 1, 2, 3, 4 ]
var sum = 0
for elem in arr {
sum += elem
}
// sum now is 10
A Modest Intro To Swift — ATO 2017 — @genehack 33
flow control: loops
for index in 1 ... 10 {
# do something 10 times
}
A Modest Intro To Swift — ATO 2017 — @genehack 34
flow control: loops
var countDown = 5
while countDown > 0 {
print("(countdown)...")
countDown--
}
print("BLASTOFF")
A Modest Intro To Swift — ATO 2017 — @genehack 35
ut oh
error: '--' is unavailable: it has been removed in Swift 3
A Modest Intro To Swift — ATO 2017 — @genehack 36
flow control: loops
var countDown = 5
while countDown > 0 {
print("(countdown)...")
countDown -= 1
}
print("BLASTOFF")
A Modest Intro To Swift — ATO 2017 — @genehack 37
remember that whole
“swift is the macintosh of apple programming languages”
thing?A Modest Intro To Swift — ATO 2017 — @genehack 38
this cuts
both waysA Modest Intro To Swift — ATO 2017 — @genehack 39
/me
whispers
“courage”
A Modest Intro To Swift — ATO 2017 — @genehack 40
flow control: switch statements
let sample = 2
switch sample {
case 0:
print("Is 0")
case 2:
print("Is 2")
default: // mandatory when cases not exclusive
print("Not 0 or 2, is it.")
}
A Modest Intro To Swift — ATO 2017 — @genehack 41
flow control: switch statements
let sample = ("foo", 2)
switch sample {
case ("foo", 3):
print("Is foo, 3")
case ("bar", _):
print("Is bar")
case (let one, let two):
print("Is (one) and (two)!")
}
A Modest Intro To Swift — ATO 2017 — @genehack 42
swift is
strongly
typed
A Modest Intro To Swift — ATO 2017 — @genehack 43
types
var foo = 1 // foo is an Int
var bar :Int // bar is an uninit'd Int
var baz = Int()
if baz is Int {
print("Nice Int you got there")
}
A Modest Intro To Swift — ATO 2017 — @genehack 44
type casts
var foo = 1 // foo is an Int
var bar = String(foo) // "1"
var maybeBaz = stringishThing as? String
// maybeBaz is an optionally typed String
var forceBaz = stringishThing as! String
A Modest Intro To Swift — ATO 2017 — @genehack 45
optional types
// When a variable may not have a value
var bar :Int?
// test
if bar != nil {
// has a value
print(bar!)
}
// unwrapping nil --> runtime exception!
A Modest Intro To Swift — ATO 2017 — @genehack 46
if-let
var bar :Int?
if let foo = bar {
// bar had a value &
// foo now has that unwrapped value
print(foo)
}
else {
// bar was nil
}
A Modest Intro To Swift — ATO 2017 — @genehack 47
if-var
var bar :Int?
if var foo = bar {
// bar had a value &
// foo now has that unwrapped value
foo += 1
}
else {
// bar was nil
}
A Modest Intro To Swift — ATO 2017 — @genehack 48
types of
variables
A Modest Intro To Swift — ATO 2017 — @genehack 49
tuples
let tuple = ("foo", 42)
let first = tuple.0 // "foo"
let labeledTuple = (one: "foo", two: 42)
let second = labeledTuple.two // 42
A Modest Intro To Swift — ATO 2017 — @genehack 50
arrays
let nums = [1, 2, 3]
var strs :[String]
// _can_ mix & match
let mixed = [1, "foo"]
// but you probably shouldn't! in Swift 3+ this is a
// compile error unless specifically type-annotated
let mixed :[Any] = [1, "foo"]
A Modest Intro To Swift — ATO 2017 — @genehack 51
dictionaries
let stateCaps = [
"Oregon": "Salem",
"North Carolina": "Raleigh",
"Kansas": "Topeka"
]
// stateCaps has type [String:String]
A Modest Intro To Swift — ATO 2017 — @genehack 52
dictionary lookups
// subscript access returns optional type. why?
stateCaps["Oregon"] is String? // true
// use if-let or guard statement to unwrap
// or provide default
let location = stateCaps["DC"] ?? "world"
print("hello (location)!")
A Modest Intro To Swift — ATO 2017 — @genehack 53
sets
var petSet :Set = [ "cat", "dog",
"fish", "dog"]
petSet.count // returns 3
A Modest Intro To Swift — ATO 2017 — @genehack 54
all these variable types
provide a rich set of
methodsA Modest Intro To Swift — ATO 2017 — @genehack 55
functions
A Modest Intro To Swift — ATO 2017 — @genehack 56
functions
func obExample () {
print("Hello, ATO!")
}
// call like:
obExample()
A Modest Intro To Swift — ATO 2017 — @genehack 57
functions with arguments
func obExample (who :String) {
print("Hello, (who)!")
}
// call like
obExample(who: "ATO 2017")
A Modest Intro To Swift — ATO 2017 — @genehack 58
functions with return values
func obExample (who :String) -> String {
return "Hello, (who)!"
}
// call like
let greets = obExample(who: "ATO")
// greets == "Hello, ATO"
A Modest Intro To Swift — ATO 2017 — @genehack 59
functions with default argument values
func obExample (who :String = "Swift") -> String {
return "Hello, (who)!"
}
// call like
let greets = obExample(who:"ATO")
// "Hello, ATO!"
let defGreets = obExample()
// "Hello, Swift!"
A Modest Intro To Swift — ATO 2017 — @genehack 60
functions with stupid parameter name tricks
func obExample (what :String = "Hello",
who them :String = "Swift") {
print("(what), (them)!")
}
// call like
obExample(what: "bye") // "bye, Swift!"
obExample(what: "bye", who: "Felicia") // "bye, Felicia!"
A Modest Intro To Swift — ATO 2017 — @genehack 61
functions with stupid parameter name tricks
func obExample (what :String = "Hello",
_ who :String = "Swift") {
print "(what), (who)!"
}
// call like
obExample(what: "bye") // "bye, Swift!"
obExample(what: "bye", who:"Felicia") // COMPILE ERROR
obExample(what: "bye", "Felicia") // "bye, Felicia!"
A Modest Intro To Swift — ATO 2017 — @genehack 62
variadiac functions
func sum (_ nums :Int...) -> Int {
// nums is Array[Int]
return nums.reduce(0, { $0 + $1 })
}
sum(1, 2, 3) // 6
A Modest Intro To Swift — ATO 2017 — @genehack 63
functions
are first class
citizens
A Modest Intro To Swift — ATO 2017 — @genehack 64
closures
let numbers = [2, 1, 56, 32, 120, 13]
var sorted = numbers.sorted(by: {
(n1 :Int, n2 :Int) -> Bool in return n2 > n1
})
// sorted = [1, 2, 13, 32, 56, 120]
A Modest Intro To Swift — ATO 2017 — @genehack 65
closures
let numbers = [2, 1, 56, 32, 120, 13]
var sorted = numbers.sorted(by: {
(n1 :Int, n2 :Int) -> Bool
in
return n2 > n1
})
// sorted = [1, 2, 13, 32, 56, 120]
A Modest Intro To Swift — ATO 2017 — @genehack 66
closures
let numbers = [2, 1, 56, 32, 120, 13]
// inferred function signature
var sorted = numbers.sorted(by: {n1, n2 in return n2 > n1})
// sorted = [1, 2, 13, 32, 56, 120]
A Modest Intro To Swift — ATO 2017 — @genehack 67
closures
let numbers = [2, 1, 56, 32, 120, 13]
// inferred function signature
// *and* positionally named parameters
var sorted = numbers.sorted(by: {return $0 > $1})
// sorted = [1, 2, 13, 32, 56, 120]
A Modest Intro To Swift — ATO 2017 — @genehack 68
closures
let numbers = [2, 1, 56, 32, 120, 13]
// when closure is last param,
// param name & parens optional
var sorted = numbers.sorted { $0 > $1 }
// sorted = [1, 2, 13, 32, 56, 120]
A Modest Intro To Swift — ATO 2017 — @genehack 69
closures
// these do the exact same thing
var sorted = numbers.sorted(by: {
(n1 :Int, n2 :Int) -> Bool in return n2 > n1
})
var sorted = numbers.sorted { $0 > $1 }
A Modest Intro To Swift — ATO 2017 — @genehack 70
oop
is also well
supported
A Modest Intro To Swift — ATO 2017 — @genehack 71
classes
class Dog {
}
A Modest Intro To Swift — ATO 2017 — @genehack 72
properties in classes
class Dog {
var name :String
let noise = "WOOF!"
}
A Modest Intro To Swift — ATO 2017 — @genehack 73
properties in classes
class Dog {
var name :String
let noise = "WOOF!"
}
// Class ‘Dog’ has no initializers
A Modest Intro To Swift — ATO 2017 — @genehack 74
properties in classes
class Dog {
var name :String?
let noise = "WOOF!"
}
A Modest Intro To Swift — ATO 2017 — @genehack 75
initializers
class Dog {
var name :String
let noise = "WOOF"
init (name :String) {
self.name = name
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 76
deinitializers
class Dog {
var name :String
let noise = "WOOF"
init (name :String) {
self.name = name
}
deinit () {
// clean up stuff here
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 77
methods
class Dog {
var name :String
let noise = "WOOF"
init (name :String) {
self.name = name
}
func speak () -> String {
return self.noise
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 78
using objects
let sammy = Dog(name: "Sammy");
// sammy is Dog
print(sammy.name) // prints "Sammyn"
print(sammy.speak()) // prints "WOOF!n"
sammy.name = "Buster" // works b/c prop is var
A Modest Intro To Swift — ATO 2017 — @genehack 79
computed properties
class Square {
var side :Float
init (side :Float) { self.side = side }
var perimeter :Float {
get {
return 4 * self.side
}
set {
self.side = newValue / 4
}
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 80
computed properties
class Square {
var side :Float
init (side :Float) { self.side = side }
var perimeter :Float {
get {
return 4 * self.side
}
set (perimeter) {
self.side = perimeter / 4
}
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 81
inheritance
A Modest Intro To Swift — ATO 2017 — @genehack 82
inheritance
class Animal {
}
class Dog :Animal {
}
A Modest Intro To Swift — ATO 2017 — @genehack 83
inheritance
class Animal {
let name :String
init (name :String) {
self.name = name
}
}
class Dog :Animal {
override init (name: String) {
super.init(name: name)
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 84
structs &
enumerations
A Modest Intro To Swift — ATO 2017 — @genehack 85
structs
struct Animal {
var name :String
var noise :String
init (name :String, makes :String) {
self.name = name
noise = makes
}
func speak () -> String {
return noise
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 86
enumerations
enum OpenSourceConfs {
case AllThingsOpen
case OSCON
}
var conf = OpenSourceConfs.AllThingsOpen
// conf is type OpenSourceConfs
A Modest Intro To Swift — ATO 2017 — @genehack 87
enumerations
enum OpenSourceConfs :Int {
case AllThingsOpen = 1
case OSCON
}
var conf = OpenSourceConfs.OSCON
// conf is type OpenSourceConfs
conf.rawValue // 2
A Modest Intro To Swift — ATO 2017 — @genehack 88
functions in enumerations
enum OpenSourceConfs {
case AllThingsOpen
case OSCON
func describe() -> String {
switch self {
case .AllThingsOpen:
return "Hello Raleigh!"
case .OSCON:
return "Hello Portland!"
}
}
}
var conf = OpenSourceConfs.AllThingsOpen
conf.describe()
A Modest Intro To Swift — ATO 2017 — @genehack 89
functions in enumerations
enum OpenSourceConfs {
case AllThingsOpen
case OSCON(String)
func describe() -> String {
switch self {
case .AllThingsOpen:
return "Hello Raleigh!"
case .OSCON (let location):
return "Hello (location)!"
}
}
}
var conf = OpenSourceConfs.OSCON("Portland")
conf.describe()
A Modest Intro To Swift — ATO 2017 — @genehack 90
functions in enumerations
enum OpenSourceConfs {
case AllThingsOpen
case OSCON(String)
func describe() -> String {
switch self {
case .AllThingsOpen:
return "Hello Raleigh!"
case .OSCON (let location):
return "Hello (location)!"
}
}
}
var oscon2017 = OpenSourceConfs.OSCON("Austin")
var oscon2018 = OpenSourceConfs.OSCON("Portland")
A Modest Intro To Swift — ATO 2017 — @genehack 91
protocols
A Modest Intro To Swift — ATO 2017 — @genehack 92
protocols
protocol Talker {
var noise :String { get }
func talk () -> String
}
A Modest Intro To Swift — ATO 2017 — @genehack 93
protocols
protocol Talker {
var noise :String { get }
func talk () -> String
mutating func mute()
}
class Dog: Talker {
var noise :String
init (noise :String) {
self.noise = noise
}
func talk () -> String {
return noise
}
func mute () {
noise = ""
}
}
A Modest Intro To Swift — ATO 2017 — @genehack 94
protocols are types
protocol Talker { ... }
class Dog :Talker { ... }
class Fish { ... }
var sammy :Talker
sammy = Dog(noise: "WOOF!")
sammy = Fish() // compile error
A Modest Intro To Swift — ATO 2017 — @genehack 95
extensions
A Modest Intro To Swift — ATO 2017 — @genehack 96
extensions
extension Int {
func squared () -> Int {
return self * self
}
}
let foo = 2
print(foo.squared()) // 4
print(foo.squared().squared()) // 16
A Modest Intro To Swift — ATO 2017 — @genehack 97
exceptions
& error handling
A Modest Intro To Swift — ATO 2017 — @genehack 98
exceptions
enum TalkErrors :Error {
case TooShort
case TooLong
case TooBoring
}
func giveATalk (talk :String) throws -> String {
if talk == "boring" {
throw TalkErrors.TooBoring
}
return "talk!"
}
A Modest Intro To Swift — ATO 2017 — @genehack 99
catching exceptions
do {
let thisTalk = try giveATalk(talk: "boring")
print(thisTalk)
}
catch {
print(error)
}
A Modest Intro To Swift — ATO 2017 — @genehack 100
catching exceptions
do {
let thisTalk = try giveATalk(talk: "fine")
print(thisTalk)
}
catch TalkErrors.TooLong {
print("shut up already")
}
catch let talkError as TalkErrors {
print("Talk error: (talkError).")
}
catch {
print(error)
}
A Modest Intro To Swift — ATO 2017 — @genehack 101
not catching exceptions
// silently discards error
let thisTalk = try? giveATalk(talk:"fine")
// thisTalk is String?
A Modest Intro To Swift — ATO 2017 — @genehack 102
defer
func needsMuchSetupAndTearDown () {
// do the setup here, open files, etc.
defer {
// and do the cleanup here,
// right next to set up
}
// other code here.
}
A Modest Intro To Swift — ATO 2017 — @genehack 103
playgrounds
A Modest Intro To Swift — ATO 2017 — @genehack 104
ill-advised
live demo
timeA Modest Intro To Swift — ATO 2017 — @genehack 105
playgrounds
A Modest Intro To Swift — ATO 2017 — @genehack 106
https://developer.apple.com/swift
A Modest Intro To Swift — ATO 2017 — @genehack 107
A Modest Intro To Swift — ATO 2017 — @genehack 108
“Learning Swift”
3rd edition now in early release
A Modest Intro To Swift — ATO 2017 — @genehack 109
playgrounds
on ipad
A Modest Intro To Swift — ATO 2017 — @genehack 110
thanks!
A Modest Intro To Swift — ATO 2017 — @genehack 111
A Modest Intro To Swift — ATO 2017 — @genehack 112
questions?
A Modest Intro To Swift — ATO 2017 — @genehack 113

Mais conteúdo relacionado

Mais procurados

Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPAdam Englander
 
JWT! JWT! Let it all out!
JWT! JWT! Let it all out!JWT! JWT! Let it all out!
JWT! JWT! Let it all out!John Anderson
 
Secure Programming Practices in C++ (NDC Security 2018)
Secure Programming Practices in C++ (NDC Security 2018)Secure Programming Practices in C++ (NDC Security 2018)
Secure Programming Practices in C++ (NDC Security 2018)Patricia Aas
 
Java 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java ComparisonJava 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java ComparisonJosé Paumard
 
Secure Programming Practices in C++ (NDC Oslo 2018)
Secure Programming Practices in C++ (NDC Oslo 2018)Secure Programming Practices in C++ (NDC Oslo 2018)
Secure Programming Practices in C++ (NDC Oslo 2018)Patricia Aas
 
Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Patricia Aas
 
2016年のPerl (Long version)
2016年のPerl (Long version)2016年のPerl (Long version)
2016年のPerl (Long version)charsbar
 
JDK8 : parallel programming made (too ?) easy
JDK8 : parallel programming made (too ?) easyJDK8 : parallel programming made (too ?) easy
JDK8 : parallel programming made (too ?) easyJosé Paumard
 
C++ The Principles of Most Surprise
C++ The Principles of Most SurpriseC++ The Principles of Most Surprise
C++ The Principles of Most SurprisePatricia Aas
 
Php7 hhvm and co
Php7 hhvm and coPhp7 hhvm and co
Php7 hhvm and coPierre Joye
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side SwiftJens Ravens
 
Isolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessIsolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessPatricia Aas
 
The bytecode mumbo-jumbo
The bytecode mumbo-jumboThe bytecode mumbo-jumbo
The bytecode mumbo-jumboRaimon Ràfols
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguagePatricia Aas
 
Better detection of what modules are used by some Perl 5 code
Better detection of what modules are used by some Perl 5 codeBetter detection of what modules are used by some Perl 5 code
Better detection of what modules are used by some Perl 5 codecharsbar
 

Mais procurados (20)

Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHP
 
JWT! JWT! Let it all out!
JWT! JWT! Let it all out!JWT! JWT! Let it all out!
JWT! JWT! Let it all out!
 
Secure Programming Practices in C++ (NDC Security 2018)
Secure Programming Practices in C++ (NDC Security 2018)Secure Programming Practices in C++ (NDC Security 2018)
Secure Programming Practices in C++ (NDC Security 2018)
 
Java 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java ComparisonJava 8 Streams and Rx Java Comparison
Java 8 Streams and Rx Java Comparison
 
Secure Programming Practices in C++ (NDC Oslo 2018)
Secure Programming Practices in C++ (NDC Oslo 2018)Secure Programming Practices in C++ (NDC Oslo 2018)
Secure Programming Practices in C++ (NDC Oslo 2018)
 
Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)
 
2016年のPerl (Long version)
2016年のPerl (Long version)2016年のPerl (Long version)
2016年のPerl (Long version)
 
JDK8 : parallel programming made (too ?) easy
JDK8 : parallel programming made (too ?) easyJDK8 : parallel programming made (too ?) easy
JDK8 : parallel programming made (too ?) easy
 
C++ The Principles of Most Surprise
C++ The Principles of Most SurpriseC++ The Principles of Most Surprise
C++ The Principles of Most Surprise
 
Php7 hhvm and co
Php7 hhvm and coPhp7 hhvm and co
Php7 hhvm and co
 
Php extensions
Php extensionsPhp extensions
Php extensions
 
C++ nots
C++ notsC++ nots
C++ nots
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
Isolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessIsolating GPU Access in its Own Process
Isolating GPU Access in its Own Process
 
The bytecode mumbo-jumbo
The bytecode mumbo-jumboThe bytecode mumbo-jumbo
The bytecode mumbo-jumbo
 
Habitat Service Discovery
Habitat Service DiscoveryHabitat Service Discovery
Habitat Service Discovery
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming Language
 
ssh.isdn.test
ssh.isdn.testssh.isdn.test
ssh.isdn.test
 
Better detection of what modules are used by some Perl 5 code
Better detection of what modules are used by some Perl 5 codeBetter detection of what modules are used by some Perl 5 code
Better detection of what modules are used by some Perl 5 code
 

Semelhante a A Modest Introduction To Swift

A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to SwiftJohn Anderson
 
A Modest Introduction To Swift
A Modest Introduction To SwiftA Modest Introduction To Swift
A Modest Introduction To SwiftJohn Anderson
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma IntroduçãoÍgor Bonadio
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATSKiwamu Okabe
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate CompilersFunctional Thursday
 
Writing Maintainable Perl
Writing Maintainable PerlWriting Maintainable Perl
Writing Maintainable Perltinypigdotcom
 
Overloading Perl OPs using XS
Overloading Perl OPs using XSOverloading Perl OPs using XS
Overloading Perl OPs using XSℕicolas ℝ.
 
Building Interpreters with PyPy
Building Interpreters with PyPyBuilding Interpreters with PyPy
Building Interpreters with PyPyDaniel Neuhäuser
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly LanguageMotaz Saad
 
FunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - StreamsFunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - Streamsdarach
 
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)osfameron
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserYodalee
 
shellScriptAlt.pptx
shellScriptAlt.pptxshellScriptAlt.pptx
shellScriptAlt.pptxNiladriDey18
 
Swift internals
Swift internalsSwift internals
Swift internalsJung Kim
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?osfameron
 
InterConnect: Server Side Swift for Java Developers
InterConnect:  Server Side Swift for Java DevelopersInterConnect:  Server Side Swift for Java Developers
InterConnect: Server Side Swift for Java DevelopersChris Bailey
 

Semelhante a A Modest Introduction To Swift (20)

A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to Swift
 
A Modest Introduction To Swift
A Modest Introduction To SwiftA Modest Introduction To Swift
A Modest Introduction To Swift
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma Introdução
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
Php 7 evolution
Php 7 evolutionPhp 7 evolution
Php 7 evolution
 
Writing Maintainable Perl
Writing Maintainable PerlWriting Maintainable Perl
Writing Maintainable Perl
 
Overloading Perl OPs using XS
Overloading Perl OPs using XSOverloading Perl OPs using XS
Overloading Perl OPs using XS
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
Building Interpreters with PyPy
Building Interpreters with PyPyBuilding Interpreters with PyPy
Building Interpreters with PyPy
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
FunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - StreamsFunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - Streams
 
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language Parser
 
Perl tutorial final
Perl tutorial finalPerl tutorial final
Perl tutorial final
 
shellScriptAlt.pptx
shellScriptAlt.pptxshellScriptAlt.pptx
shellScriptAlt.pptx
 
Swift internals
Swift internalsSwift internals
Swift internals
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
 
InterConnect: Server Side Swift for Java Developers
InterConnect:  Server Side Swift for Java DevelopersInterConnect:  Server Side Swift for Java Developers
InterConnect: Server Side Swift for Java Developers
 

Mais de John Anderson

Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers)Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers)John Anderson
 
Logs are-magic-devfestweekend2018
Logs are-magic-devfestweekend2018Logs are-magic-devfestweekend2018
Logs are-magic-devfestweekend2018John Anderson
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouJohn Anderson
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning projectJohn Anderson
 
Do you want to be right or do you want to WIN?
Do you want to be right or do you want to WIN?Do you want to be right or do you want to WIN?
Do you want to be right or do you want to WIN?John Anderson
 
An Introduction to Git (even for non-developers)
An Introduction to Git (even for non-developers)An Introduction to Git (even for non-developers)
An Introduction to Git (even for non-developers)John Anderson
 
You got chocolate in my peanut butter! .NET on Mac & Linux
You got chocolate in my peanut butter! .NET on Mac & LinuxYou got chocolate in my peanut butter! .NET on Mac & Linux
You got chocolate in my peanut butter! .NET on Mac & LinuxJohn Anderson
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning projectJohn Anderson
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyJohn Anderson
 
Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)John Anderson
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-DevelopersJohn Anderson
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning projectJohn Anderson
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouJohn Anderson
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJohn Anderson
 
Old Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyOld Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyJohn Anderson
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouJohn Anderson
 
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...John Anderson
 
Logs Are Magic! Why git workflows & commit structure should matter to you
Logs Are Magic! Why git workflows & commit structure should matter to youLogs Are Magic! Why git workflows & commit structure should matter to you
Logs Are Magic! Why git workflows & commit structure should matter to youJohn Anderson
 

Mais de John Anderson (20)

#speakerlife
#speakerlife#speakerlife
#speakerlife
 
Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers)Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers)
 
Logs are-magic-devfestweekend2018
Logs are-magic-devfestweekend2018Logs are-magic-devfestweekend2018
Logs are-magic-devfestweekend2018
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning project
 
Do you want to be right or do you want to WIN?
Do you want to be right or do you want to WIN?Do you want to be right or do you want to WIN?
Do you want to be right or do you want to WIN?
 
An Introduction to Git (even for non-developers)
An Introduction to Git (even for non-developers)An Introduction to Git (even for non-developers)
An Introduction to Git (even for non-developers)
 
You got chocolate in my peanut butter! .NET on Mac & Linux
You got chocolate in my peanut butter! .NET on Mac & LinuxYou got chocolate in my peanut butter! .NET on Mac & Linux
You got chocolate in my peanut butter! .NET on Mac & Linux
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning project
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This Century
 
Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-Developers
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning project
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 
Old Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyOld Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This Century
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
 
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
 
Logs Are Magic! Why git workflows & commit structure should matter to you
Logs Are Magic! Why git workflows & commit structure should matter to youLogs Are Magic! Why git workflows & commit structure should matter to you
Logs Are Magic! Why git workflows & commit structure should matter to you
 
#speakerlife
#speakerlife#speakerlife
#speakerlife
 

Último

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Último (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

A Modest Introduction To Swift

  • 1. A Modest Intro To Swift — ATO 2017 — @genehack 1
  • 2. a modest introduction to swiftjohn sj anderson | @genehack | ato 2017 A Modest Intro To Swift — ATO 2017 — @genehack 2
  • 3. sorry!A Modest Intro To Swift — ATO 2017 — @genehack 3
  • 4. hi i’m john aka @genehack vp tech, infinity interactive A Modest Intro To Swift — ATO 2017 — @genehack 4
  • 5. swift?A Modest Intro To Swift — ATO 2017 — @genehack 5
  • 6. introduced in 2014A Modest Intro To Swift — ATO 2017 — @genehack 6
  • 7. open source at version 2.2 A Modest Intro To Swift — ATO 2017 — @genehack 7
  • 8. version 4.0 just released (in september) A Modest Intro To Swift — ATO 2017 — @genehack 8
  • 9. originally macOS only A Modest Intro To Swift — ATO 2017 — @genehack 9
  • 10. now also on linuxA Modest Intro To Swift — ATO 2017 — @genehack 10
  • 11. A Modest Intro To Swift — ATO 2017 — @genehack 11
  • 12. also on android and windows A Modest Intro To Swift — ATO 2017 — @genehack 12
  • 13. so what’s it like, maaan? A Modest Intro To Swift — ATO 2017 — @genehack 13
  • 14. first, a brief digression A Modest Intro To Swift — ATO 2017 — @genehack 14
  • 15. how many macOS / iOS users do we have here?A Modest Intro To Swift — ATO 2017 — @genehack 15
  • 16. how many macOS / iOS developers do we have? A Modest Intro To Swift — ATO 2017 — @genehack 16
  • 17. the dirty little secret of developing for apple platforms A Modest Intro To Swift — ATO 2017 — @genehack 17
  • 18. from“In The Beginning Was The Command Line” by neal stephenson A Modest Intro To Swift — ATO 2017 — @genehack 18
  • 19. weird pascal-based naming & calling conventions A Modest Intro To Swift — ATO 2017 — @genehack 19
  • 20. handles?!? A Modest Intro To Swift — ATO 2017 — @genehack 20
  • 21. objective c’s “syntax” A Modest Intro To Swift — ATO 2017 — @genehack 21
  • 22. swift is the macintosh of apple programming languages A Modest Intro To Swift — ATO 2017 — @genehack 22
  • 23. swift syntax A Modest Intro To Swift — ATO 2017 — @genehack 23
  • 24. comments // this is a comment A Modest Intro To Swift — ATO 2017 — @genehack 24
  • 25. comments /* this is a multi-line comment */ A Modest Intro To Swift — ATO 2017 — @genehack 25
  • 26. comments /* this is a /* _nested_ multi-line comment, */ which is cool! */ A Modest Intro To Swift — ATO 2017 — @genehack 26
  • 27. variables var foo = 1 var bar :Int var baz = "whee!" A Modest Intro To Swift — ATO 2017 — @genehack 27
  • 28. variables let bar = 1 A Modest Intro To Swift — ATO 2017 — @genehack 28
  • 29. variables let bar = 1 bar += 1 // ^^ compile time error! A Modest Intro To Swift — ATO 2017 — @genehack 29
  • 30. variables let bar // also a compile time error // You CANNOT have an untyped, uninitialized variable. // You also can't use an uninitialized variable _at all_. A Modest Intro To Swift — ATO 2017 — @genehack 30
  • 31. how friggin’ awesome is that? A Modest Intro To Swift — ATO 2017 — @genehack 31
  • 32. flow control: conditionals let n = 1 if n > 1 { print("we got a big N here") } A Modest Intro To Swift — ATO 2017 — @genehack 32
  • 33. flow control: loops let arr = [ 1, 2, 3, 4 ] var sum = 0 for elem in arr { sum += elem } // sum now is 10 A Modest Intro To Swift — ATO 2017 — @genehack 33
  • 34. flow control: loops for index in 1 ... 10 { # do something 10 times } A Modest Intro To Swift — ATO 2017 — @genehack 34
  • 35. flow control: loops var countDown = 5 while countDown > 0 { print("(countdown)...") countDown-- } print("BLASTOFF") A Modest Intro To Swift — ATO 2017 — @genehack 35
  • 36. ut oh error: '--' is unavailable: it has been removed in Swift 3 A Modest Intro To Swift — ATO 2017 — @genehack 36
  • 37. flow control: loops var countDown = 5 while countDown > 0 { print("(countdown)...") countDown -= 1 } print("BLASTOFF") A Modest Intro To Swift — ATO 2017 — @genehack 37
  • 38. remember that whole “swift is the macintosh of apple programming languages” thing?A Modest Intro To Swift — ATO 2017 — @genehack 38
  • 39. this cuts both waysA Modest Intro To Swift — ATO 2017 — @genehack 39
  • 40. /me whispers “courage” A Modest Intro To Swift — ATO 2017 — @genehack 40
  • 41. flow control: switch statements let sample = 2 switch sample { case 0: print("Is 0") case 2: print("Is 2") default: // mandatory when cases not exclusive print("Not 0 or 2, is it.") } A Modest Intro To Swift — ATO 2017 — @genehack 41
  • 42. flow control: switch statements let sample = ("foo", 2) switch sample { case ("foo", 3): print("Is foo, 3") case ("bar", _): print("Is bar") case (let one, let two): print("Is (one) and (two)!") } A Modest Intro To Swift — ATO 2017 — @genehack 42
  • 43. swift is strongly typed A Modest Intro To Swift — ATO 2017 — @genehack 43
  • 44. types var foo = 1 // foo is an Int var bar :Int // bar is an uninit'd Int var baz = Int() if baz is Int { print("Nice Int you got there") } A Modest Intro To Swift — ATO 2017 — @genehack 44
  • 45. type casts var foo = 1 // foo is an Int var bar = String(foo) // "1" var maybeBaz = stringishThing as? String // maybeBaz is an optionally typed String var forceBaz = stringishThing as! String A Modest Intro To Swift — ATO 2017 — @genehack 45
  • 46. optional types // When a variable may not have a value var bar :Int? // test if bar != nil { // has a value print(bar!) } // unwrapping nil --> runtime exception! A Modest Intro To Swift — ATO 2017 — @genehack 46
  • 47. if-let var bar :Int? if let foo = bar { // bar had a value & // foo now has that unwrapped value print(foo) } else { // bar was nil } A Modest Intro To Swift — ATO 2017 — @genehack 47
  • 48. if-var var bar :Int? if var foo = bar { // bar had a value & // foo now has that unwrapped value foo += 1 } else { // bar was nil } A Modest Intro To Swift — ATO 2017 — @genehack 48
  • 49. types of variables A Modest Intro To Swift — ATO 2017 — @genehack 49
  • 50. tuples let tuple = ("foo", 42) let first = tuple.0 // "foo" let labeledTuple = (one: "foo", two: 42) let second = labeledTuple.two // 42 A Modest Intro To Swift — ATO 2017 — @genehack 50
  • 51. arrays let nums = [1, 2, 3] var strs :[String] // _can_ mix & match let mixed = [1, "foo"] // but you probably shouldn't! in Swift 3+ this is a // compile error unless specifically type-annotated let mixed :[Any] = [1, "foo"] A Modest Intro To Swift — ATO 2017 — @genehack 51
  • 52. dictionaries let stateCaps = [ "Oregon": "Salem", "North Carolina": "Raleigh", "Kansas": "Topeka" ] // stateCaps has type [String:String] A Modest Intro To Swift — ATO 2017 — @genehack 52
  • 53. dictionary lookups // subscript access returns optional type. why? stateCaps["Oregon"] is String? // true // use if-let or guard statement to unwrap // or provide default let location = stateCaps["DC"] ?? "world" print("hello (location)!") A Modest Intro To Swift — ATO 2017 — @genehack 53
  • 54. sets var petSet :Set = [ "cat", "dog", "fish", "dog"] petSet.count // returns 3 A Modest Intro To Swift — ATO 2017 — @genehack 54
  • 55. all these variable types provide a rich set of methodsA Modest Intro To Swift — ATO 2017 — @genehack 55
  • 56. functions A Modest Intro To Swift — ATO 2017 — @genehack 56
  • 57. functions func obExample () { print("Hello, ATO!") } // call like: obExample() A Modest Intro To Swift — ATO 2017 — @genehack 57
  • 58. functions with arguments func obExample (who :String) { print("Hello, (who)!") } // call like obExample(who: "ATO 2017") A Modest Intro To Swift — ATO 2017 — @genehack 58
  • 59. functions with return values func obExample (who :String) -> String { return "Hello, (who)!" } // call like let greets = obExample(who: "ATO") // greets == "Hello, ATO" A Modest Intro To Swift — ATO 2017 — @genehack 59
  • 60. functions with default argument values func obExample (who :String = "Swift") -> String { return "Hello, (who)!" } // call like let greets = obExample(who:"ATO") // "Hello, ATO!" let defGreets = obExample() // "Hello, Swift!" A Modest Intro To Swift — ATO 2017 — @genehack 60
  • 61. functions with stupid parameter name tricks func obExample (what :String = "Hello", who them :String = "Swift") { print("(what), (them)!") } // call like obExample(what: "bye") // "bye, Swift!" obExample(what: "bye", who: "Felicia") // "bye, Felicia!" A Modest Intro To Swift — ATO 2017 — @genehack 61
  • 62. functions with stupid parameter name tricks func obExample (what :String = "Hello", _ who :String = "Swift") { print "(what), (who)!" } // call like obExample(what: "bye") // "bye, Swift!" obExample(what: "bye", who:"Felicia") // COMPILE ERROR obExample(what: "bye", "Felicia") // "bye, Felicia!" A Modest Intro To Swift — ATO 2017 — @genehack 62
  • 63. variadiac functions func sum (_ nums :Int...) -> Int { // nums is Array[Int] return nums.reduce(0, { $0 + $1 }) } sum(1, 2, 3) // 6 A Modest Intro To Swift — ATO 2017 — @genehack 63
  • 64. functions are first class citizens A Modest Intro To Swift — ATO 2017 — @genehack 64
  • 65. closures let numbers = [2, 1, 56, 32, 120, 13] var sorted = numbers.sorted(by: { (n1 :Int, n2 :Int) -> Bool in return n2 > n1 }) // sorted = [1, 2, 13, 32, 56, 120] A Modest Intro To Swift — ATO 2017 — @genehack 65
  • 66. closures let numbers = [2, 1, 56, 32, 120, 13] var sorted = numbers.sorted(by: { (n1 :Int, n2 :Int) -> Bool in return n2 > n1 }) // sorted = [1, 2, 13, 32, 56, 120] A Modest Intro To Swift — ATO 2017 — @genehack 66
  • 67. closures let numbers = [2, 1, 56, 32, 120, 13] // inferred function signature var sorted = numbers.sorted(by: {n1, n2 in return n2 > n1}) // sorted = [1, 2, 13, 32, 56, 120] A Modest Intro To Swift — ATO 2017 — @genehack 67
  • 68. closures let numbers = [2, 1, 56, 32, 120, 13] // inferred function signature // *and* positionally named parameters var sorted = numbers.sorted(by: {return $0 > $1}) // sorted = [1, 2, 13, 32, 56, 120] A Modest Intro To Swift — ATO 2017 — @genehack 68
  • 69. closures let numbers = [2, 1, 56, 32, 120, 13] // when closure is last param, // param name & parens optional var sorted = numbers.sorted { $0 > $1 } // sorted = [1, 2, 13, 32, 56, 120] A Modest Intro To Swift — ATO 2017 — @genehack 69
  • 70. closures // these do the exact same thing var sorted = numbers.sorted(by: { (n1 :Int, n2 :Int) -> Bool in return n2 > n1 }) var sorted = numbers.sorted { $0 > $1 } A Modest Intro To Swift — ATO 2017 — @genehack 70
  • 71. oop is also well supported A Modest Intro To Swift — ATO 2017 — @genehack 71
  • 72. classes class Dog { } A Modest Intro To Swift — ATO 2017 — @genehack 72
  • 73. properties in classes class Dog { var name :String let noise = "WOOF!" } A Modest Intro To Swift — ATO 2017 — @genehack 73
  • 74. properties in classes class Dog { var name :String let noise = "WOOF!" } // Class ‘Dog’ has no initializers A Modest Intro To Swift — ATO 2017 — @genehack 74
  • 75. properties in classes class Dog { var name :String? let noise = "WOOF!" } A Modest Intro To Swift — ATO 2017 — @genehack 75
  • 76. initializers class Dog { var name :String let noise = "WOOF" init (name :String) { self.name = name } } A Modest Intro To Swift — ATO 2017 — @genehack 76
  • 77. deinitializers class Dog { var name :String let noise = "WOOF" init (name :String) { self.name = name } deinit () { // clean up stuff here } } A Modest Intro To Swift — ATO 2017 — @genehack 77
  • 78. methods class Dog { var name :String let noise = "WOOF" init (name :String) { self.name = name } func speak () -> String { return self.noise } } A Modest Intro To Swift — ATO 2017 — @genehack 78
  • 79. using objects let sammy = Dog(name: "Sammy"); // sammy is Dog print(sammy.name) // prints "Sammyn" print(sammy.speak()) // prints "WOOF!n" sammy.name = "Buster" // works b/c prop is var A Modest Intro To Swift — ATO 2017 — @genehack 79
  • 80. computed properties class Square { var side :Float init (side :Float) { self.side = side } var perimeter :Float { get { return 4 * self.side } set { self.side = newValue / 4 } } } A Modest Intro To Swift — ATO 2017 — @genehack 80
  • 81. computed properties class Square { var side :Float init (side :Float) { self.side = side } var perimeter :Float { get { return 4 * self.side } set (perimeter) { self.side = perimeter / 4 } } } A Modest Intro To Swift — ATO 2017 — @genehack 81
  • 82. inheritance A Modest Intro To Swift — ATO 2017 — @genehack 82
  • 83. inheritance class Animal { } class Dog :Animal { } A Modest Intro To Swift — ATO 2017 — @genehack 83
  • 84. inheritance class Animal { let name :String init (name :String) { self.name = name } } class Dog :Animal { override init (name: String) { super.init(name: name) } } A Modest Intro To Swift — ATO 2017 — @genehack 84
  • 85. structs & enumerations A Modest Intro To Swift — ATO 2017 — @genehack 85
  • 86. structs struct Animal { var name :String var noise :String init (name :String, makes :String) { self.name = name noise = makes } func speak () -> String { return noise } } A Modest Intro To Swift — ATO 2017 — @genehack 86
  • 87. enumerations enum OpenSourceConfs { case AllThingsOpen case OSCON } var conf = OpenSourceConfs.AllThingsOpen // conf is type OpenSourceConfs A Modest Intro To Swift — ATO 2017 — @genehack 87
  • 88. enumerations enum OpenSourceConfs :Int { case AllThingsOpen = 1 case OSCON } var conf = OpenSourceConfs.OSCON // conf is type OpenSourceConfs conf.rawValue // 2 A Modest Intro To Swift — ATO 2017 — @genehack 88
  • 89. functions in enumerations enum OpenSourceConfs { case AllThingsOpen case OSCON func describe() -> String { switch self { case .AllThingsOpen: return "Hello Raleigh!" case .OSCON: return "Hello Portland!" } } } var conf = OpenSourceConfs.AllThingsOpen conf.describe() A Modest Intro To Swift — ATO 2017 — @genehack 89
  • 90. functions in enumerations enum OpenSourceConfs { case AllThingsOpen case OSCON(String) func describe() -> String { switch self { case .AllThingsOpen: return "Hello Raleigh!" case .OSCON (let location): return "Hello (location)!" } } } var conf = OpenSourceConfs.OSCON("Portland") conf.describe() A Modest Intro To Swift — ATO 2017 — @genehack 90
  • 91. functions in enumerations enum OpenSourceConfs { case AllThingsOpen case OSCON(String) func describe() -> String { switch self { case .AllThingsOpen: return "Hello Raleigh!" case .OSCON (let location): return "Hello (location)!" } } } var oscon2017 = OpenSourceConfs.OSCON("Austin") var oscon2018 = OpenSourceConfs.OSCON("Portland") A Modest Intro To Swift — ATO 2017 — @genehack 91
  • 92. protocols A Modest Intro To Swift — ATO 2017 — @genehack 92
  • 93. protocols protocol Talker { var noise :String { get } func talk () -> String } A Modest Intro To Swift — ATO 2017 — @genehack 93
  • 94. protocols protocol Talker { var noise :String { get } func talk () -> String mutating func mute() } class Dog: Talker { var noise :String init (noise :String) { self.noise = noise } func talk () -> String { return noise } func mute () { noise = "" } } A Modest Intro To Swift — ATO 2017 — @genehack 94
  • 95. protocols are types protocol Talker { ... } class Dog :Talker { ... } class Fish { ... } var sammy :Talker sammy = Dog(noise: "WOOF!") sammy = Fish() // compile error A Modest Intro To Swift — ATO 2017 — @genehack 95
  • 96. extensions A Modest Intro To Swift — ATO 2017 — @genehack 96
  • 97. extensions extension Int { func squared () -> Int { return self * self } } let foo = 2 print(foo.squared()) // 4 print(foo.squared().squared()) // 16 A Modest Intro To Swift — ATO 2017 — @genehack 97
  • 98. exceptions & error handling A Modest Intro To Swift — ATO 2017 — @genehack 98
  • 99. exceptions enum TalkErrors :Error { case TooShort case TooLong case TooBoring } func giveATalk (talk :String) throws -> String { if talk == "boring" { throw TalkErrors.TooBoring } return "talk!" } A Modest Intro To Swift — ATO 2017 — @genehack 99
  • 100. catching exceptions do { let thisTalk = try giveATalk(talk: "boring") print(thisTalk) } catch { print(error) } A Modest Intro To Swift — ATO 2017 — @genehack 100
  • 101. catching exceptions do { let thisTalk = try giveATalk(talk: "fine") print(thisTalk) } catch TalkErrors.TooLong { print("shut up already") } catch let talkError as TalkErrors { print("Talk error: (talkError).") } catch { print(error) } A Modest Intro To Swift — ATO 2017 — @genehack 101
  • 102. not catching exceptions // silently discards error let thisTalk = try? giveATalk(talk:"fine") // thisTalk is String? A Modest Intro To Swift — ATO 2017 — @genehack 102
  • 103. defer func needsMuchSetupAndTearDown () { // do the setup here, open files, etc. defer { // and do the cleanup here, // right next to set up } // other code here. } A Modest Intro To Swift — ATO 2017 — @genehack 103
  • 104. playgrounds A Modest Intro To Swift — ATO 2017 — @genehack 104
  • 105. ill-advised live demo timeA Modest Intro To Swift — ATO 2017 — @genehack 105
  • 106. playgrounds A Modest Intro To Swift — ATO 2017 — @genehack 106
  • 107. https://developer.apple.com/swift A Modest Intro To Swift — ATO 2017 — @genehack 107
  • 108. A Modest Intro To Swift — ATO 2017 — @genehack 108
  • 109. “Learning Swift” 3rd edition now in early release A Modest Intro To Swift — ATO 2017 — @genehack 109
  • 110. playgrounds on ipad A Modest Intro To Swift — ATO 2017 — @genehack 110
  • 111. thanks! A Modest Intro To Swift — ATO 2017 — @genehack 111
  • 112. A Modest Intro To Swift — ATO 2017 — @genehack 112
  • 113. questions? A Modest Intro To Swift — ATO 2017 — @genehack 113